Re: [PATCH] Import svnsync tests into svnrdump

2010-07-27 Thread Stefan Sperling
On Tue, Jul 27, 2010 at 12:10:55AM +0530, Ramkumar Ramachandra wrote:
 Hi Stefan,
 
 I imported and ran the copy_and_modify test from svnsync. The diff I
 get clearly indicates what more needs to be done, and I think this
 test is very valuable. Unfortunately, `svn diff` refuses to show me
 the dumpfile itself (application/octet-stream), so here's the rest of
 the diff along with a log message:
 
 [[[
 [in subversion/tests/cmdline]
 * svnrdump_tests.py
   (copy_and_modify): Import new test from svnsync_tests.py.
   (test_list): Run this test, but expect it to fail.
 * svnrdump_tests_data/copy-and-modify.dump: Add new test data for
   copy_and_modify test.
 ]]]
 
 Index: subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump
 ===
 Cannot display: file marked as a binary type.
 svn:mime-type = application/octet-stream

Just remove the svn:mime-type property from the file,
and you should be able to send a complete diff.

Thanks,
Stefan

 Index: svnrdump_tests_data/copy-and-modify.dump
 ===
 --- subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump 
 (revision 979365)
 +++ subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump 
 (working copy)
 
 Property changes on: 
 subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump
 ___
 Added: svn:mime-type
 ## -0,0 +1 ##
 +application/octet-stream
 Index: subversion/tests/cmdline/svnrdump_tests.py
 ===
 --- subversion/tests/cmdline/svnrdump_tests.py(revision 979395)
 +++ subversion/tests/cmdline/svnrdump_tests.py(working copy)
 @@ -98,7 +98,11 @@ def basic_svnrdump(sbox):
  def revision0(sbox):
dump revision zero
run_test(sbox, dumpfile_name = revision0.dump)
 -  
 +
 +def copy_and_modify(sbox):
 +  copy and modify
 +  run_test(sbox, copy-and-modify.dump)
 +
  
  # Run the tests
  
 @@ -107,6 +111,7 @@ def revision0(sbox):
  test_list = [ None,
basic_svnrdump,
revision0,
 +  XFail(copy_and_modify),
   ]
  
  if __name__ == '__main__':
 
 
 --- EXPECTED 
 +++ ACTUAL 
 @@ -33,11 +33,11 @@
  Node-path: foo.txt
  Node-kind: file
  Node-action: add
 +Prop-delta: true
  Prop-content-length: 10
  Text-delta: true
  Text-content-length: 4
  Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
 -Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
  Content-length: 14
  
  PROPS-END
 @@ -67,14 +67,10 @@
  Node-action: add
  Node-copyfrom-rev: 1
  Node-copyfrom-path: foo.txt
 -Text-copy-source-md5: d41d8cd98f00b204e9800998ecf8427e
 -Text-copy-source-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
  Text-delta: true
  Text-delta-base-md5: d41d8cd98f00b204e9800998ecf8427e
 -Text-delta-base-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
  Text-content-length: 19
  Text-content-md5: d2508118d0d39e198d1129d87d692d59
 -Text-content-sha1: e2fb5f2139d086ded2cb600d5a91a196e76bf020
  Content-length: 19
  
  SVNmodified


Re: [PATCH] Import svnsync tests into svnrdump

2010-07-26 Thread Ramkumar Ramachandra
Hi,

Ramkumar Ramachandra writes:
 The tests in svnsync_tests_data/ are in dumpfile v2 and these are
 unsuitable for testing svnrdump. Hence, load all of them into a
 repository and re-dump them in dumpfile v3 format before attempting to
 add them to svnrdump_tests_data/. I still have to figure out how to
 extend the test framework to ignore certain headers in the diff-
 currently, using run_test() in svnrdump to run tests corresponding to
 these files will fail all tests.

I've discussed this with Daniel on the channel, and I've told him that
I specifically want this because we don't want svnrdump tests to
depend on svnadmin. Does anyone object to this patch? It was created
by dumping the data in svn-test-data/ after running svnsync_tests.py.

Thanks.

-- Ram


Re: [PATCH] Import svnsync tests into svnrdump

2010-07-26 Thread Stefan Sperling
On Mon, Jul 26, 2010 at 05:17:07PM +0530, Ramkumar Ramachandra wrote:
 Hi,
 
 Ramkumar Ramachandra writes:
  The tests in svnsync_tests_data/ are in dumpfile v2 and these are
  unsuitable for testing svnrdump. Hence, load all of them into a
  repository and re-dump them in dumpfile v3 format before attempting to
  add them to svnrdump_tests_data/. I still have to figure out how to
  extend the test framework to ignore certain headers in the diff-

What headers do you want to ignore?

  currently, using run_test() in svnrdump to run tests corresponding to
  these files will fail all tests.
 
 I've discussed this with Daniel on the channel, and I've told him that
 I specifically want this because we don't want svnrdump tests to
 depend on svnadmin. Does anyone object to this patch? It was created
 by dumping the data in svn-test-data/ after running svnsync_tests.py.
 
 Thanks.


As long as we still try to make svnrdump output make svnadmin dump output
match as much as possible, I don't object to adding v3 dump files for
svnrdump tests. That's obviously necessary because svnrdump can only do v3.

But I'd rather like this to be done one step at a time.
Please don't import test data that isn't used. Write the test using
the data, and then add the data along with the (passing or xfailing) test.

So I'd like to see a new diff with test+data before I can give a +1.
Preferably one diff per test.

Stefan


Re: [PATCH] Import svnsync tests into svnrdump

2010-07-26 Thread Ramkumar Ramachandra
Hi Stefan,

I imported and ran the copy_and_modify test from svnsync. The diff I
get clearly indicates what more needs to be done, and I think this
test is very valuable. Unfortunately, `svn diff` refuses to show me
the dumpfile itself (application/octet-stream), so here's the rest of
the diff along with a log message:

[[[
[in subversion/tests/cmdline]
* svnrdump_tests.py
  (copy_and_modify): Import new test from svnsync_tests.py.
  (test_list): Run this test, but expect it to fail.
* svnrdump_tests_data/copy-and-modify.dump: Add new test data for
  copy_and_modify test.
]]]

Index: subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump
===
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: svnrdump_tests_data/copy-and-modify.dump
===
--- subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump   
(revision 979365)
+++ subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump   
(working copy)

Property changes on: 
subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
Index: subversion/tests/cmdline/svnrdump_tests.py
===
--- subversion/tests/cmdline/svnrdump_tests.py  (revision 979395)
+++ subversion/tests/cmdline/svnrdump_tests.py  (working copy)
@@ -98,7 +98,11 @@ def basic_svnrdump(sbox):
 def revision0(sbox):
   dump revision zero
   run_test(sbox, dumpfile_name = revision0.dump)
-  
+
+def copy_and_modify(sbox):
+  copy and modify
+  run_test(sbox, copy-and-modify.dump)
+
 
 # Run the tests
 
@@ -107,6 +111,7 @@ def revision0(sbox):
 test_list = [ None,
   basic_svnrdump,
   revision0,
+  XFail(copy_and_modify),
  ]
 
 if __name__ == '__main__':


--- EXPECTED 
+++ ACTUAL 
@@ -33,11 +33,11 @@
 Node-path: foo.txt
 Node-kind: file
 Node-action: add
+Prop-delta: true
 Prop-content-length: 10
 Text-delta: true
 Text-content-length: 4
 Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
-Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
 Content-length: 14
 
 PROPS-END
@@ -67,14 +67,10 @@
 Node-action: add
 Node-copyfrom-rev: 1
 Node-copyfrom-path: foo.txt
-Text-copy-source-md5: d41d8cd98f00b204e9800998ecf8427e
-Text-copy-source-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
 Text-delta: true
 Text-delta-base-md5: d41d8cd98f00b204e9800998ecf8427e
-Text-delta-base-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
 Text-content-length: 19
 Text-content-md5: d2508118d0d39e198d1129d87d692d59
-Text-content-sha1: e2fb5f2139d086ded2cb600d5a91a196e76bf020
 Content-length: 19
 
 SVNmodified


[PATCH] Import svnsync tests into svnrdump

2010-07-24 Thread Ramkumar Ramachandra
Hi,

The tests in svnsync_tests_data/ are in dumpfile v2 and these are
unsuitable for testing svnrdump. Hence, load all of them into a
repository and re-dump them in dumpfile v3 format before attempting to
add them to svnrdump_tests_data/. I still have to figure out how to
extend the test framework to ignore certain headers in the diff-
currently, using run_test() in svnrdump to run tests corresponding to
these files will fail all tests.

Thanks.

-- Ram

[[[
[in subversion/tests/cmdline/svnrdump_tests_data/]
Import the dumpfiles corresponding to the first 13 svnsync tests from
subversion/tests/cmdline/svnsync_tests_data after converting them to
dumpfile v3 format. Files added:
* copy-and-modify.dump
* copy-from-previous-version-and-modify.dump
* copy-from-previous-version.dump
* copy-parent-modify-prop.dump
* detect-meddling.dump
* dir-prop-change.dump
* file-dir-file.dump
* modified-in-place.dump
* tag-empty-trunk.dump
* tag-trunk-with-dir.dump
* tag-trunk-with-file2.dump
* tag-trunk-with-file.dump
* tag-with-modified-file.dump
]]]

Index: 
subversion/tests/cmdline/svnrdump_tests_data/copy-from-previous-version-and-modify.dump
===
--- 
subversion/tests/cmdline/svnrdump_tests_data/copy-from-previous-version-and-modify.dump
 (revision 0)
+++ 
subversion/tests/cmdline/svnrdump_tests_data/copy-from-previous-version-and-modify.dump
 (working copy)
@@ -0,0 +1,96 @@
+SVN-fs-dump-format-version: 3
+
+UUID: 6ad9f820-0205-0410-94a2-c8cf366bb2b3
+
+Revision-number: 0
+Prop-content-length: 56
+Prop-content-md5: (svn:date) 1149e75a1dc9b23c9138242a2e7d255f
+Prop-content-sha1: (svn:date) 51b023ca17e273bb79c1b6921d6180099dfa96d0
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2005-11-07T23:36:48.095832Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 112
+Prop-content-md5: (svn:log) 028454ec513c889b513ba2840bcdef1a
+Prop-content-sha1: (svn:log) e471eead535637bfd0d9cd8f44b6d36621ffb9b8
+Prop-content-md5: (svn:author) c9bd66513549086361ea008b319307f8
+Prop-content-sha1: (svn:author) f9752bcda9e6e513d24f99a02b46cb539a5f63b9
+Prop-content-md5: (svn:date) 82b427150f118980996d1ff2f20c8ed9
+Prop-content-sha1: (svn:date) 0da5c3bee3e0d93cbe0d7094973bb169db5f184f
+Content-length: 112
+
+K 10
+svn:author
+V 6
+rooneg
+K 8
+svn:date
+V 27
+2005-11-07T23:37:17.705159Z
+K 7
+svn:log
+V 11
+add foo.txt
+PROPS-END
+
+Node-path: foo.txt
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-delta: true
+Text-content-length: 4
+Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Content-length: 14
+
+PROPS-END
+SVN
+
+Revision-number: 2
+Prop-content-length: 135
+Prop-content-md5: (svn:log) 21e740d34f10f1962e0e115eff7b00ce
+Prop-content-sha1: (svn:log) 4f1bff081e7cdc7cb82c6859162ee21010c86d60
+Prop-content-md5: (svn:author) c9bd66513549086361ea008b319307f8
+Prop-content-sha1: (svn:author) f9752bcda9e6e513d24f99a02b46cb539a5f63b9
+Prop-content-md5: (svn:date) 822d6ff42b93d5f3429b9f1db1341a0c
+Prop-content-sha1: (svn:date) 1192c3c4f4a4af789ef996b3f7cdc3cce4e3484e
+Content-length: 135
+
+K 10
+svn:author
+V 6
+rooneg
+K 8
+svn:date
+V 27
+2005-11-07T23:37:44.549695Z
+K 7
+svn:log
+V 34
+copy and change at the same time.
+
+PROPS-END
+
+Node-path: bar.txt
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: foo.txt
+Text-copy-source-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-copy-source-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Text-delta: true
+Text-delta-base-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-delta-base-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Text-content-length: 19
+Text-content-md5: d2508118d0d39e198d1129d87d692d59
+Text-content-sha1: e2fb5f2139d086ded2cb600d5a91a196e76bf020
+Content-length: 19
+
+SVN    �modified
+
+
Index: subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump
===
--- subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump   
(revision 0)
+++ subversion/tests/cmdline/svnrdump_tests_data/copy-and-modify.dump   
(working copy)
@@ -0,0 +1,96 @@
+SVN-fs-dump-format-version: 3
+
+UUID: 6ad9f820-0205-0410-94a2-c8cf366bb2b3
+
+Revision-number: 0
+Prop-content-length: 56
+Prop-content-md5: (svn:date) 1149e75a1dc9b23c9138242a2e7d255f
+Prop-content-sha1: (svn:date) 51b023ca17e273bb79c1b6921d6180099dfa96d0
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2005-11-07T23:36:48.095832Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 112
+Prop-content-md5: (svn:log) 028454ec513c889b513ba2840bcdef1a
+Prop-content-sha1: (svn:log) e471eead535637bfd0d9cd8f44b6d36621ffb9b8
+Prop-content-md5: (svn:author) c9bd66513549086361ea008b319307f8
+Prop-content-sha1: (svn:author) f9752bcda9e6e513d24f99a02b46cb539a5f63b9
+Prop-content-md5: (svn:date) 82b427150f118980996d1ff2f20c8ed9
+Prop-content-sha1: (svn:date) 0da5c3bee3e0d93cbe0d7094973bb169db5f184f