You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/10/11 22:15:54 UTC
svn commit: r1021493 - in /subversion/trunk/subversion/tests/cmdline:
svnsync_tests.py svnsync_tests_data/delete-revprops.dump
svnsync_tests_data/delete-revprops.expected.dump
Author: cmpilato
Date: Mon Oct 11 20:15:54 2010
New Revision: 1021493
URL: http://svn.apache.org/viewvc?rev=1021493&view=rev
Log:
Write a regression test for issue #3728 ("'svnsync copy-revprops'
doesn't sync revprop deletions.").
* subversion/tests/cmdline/svnsync_tests.py
(setup_and_sync, verify_mirror): New helpers, cored out of ...
(run_test): ... this, which is now just a wrapper around the
aforementioned pair of helpers.
(delete_revprops): New test.
(test_list): Add XFail'ing reference to new test.
* svnsync_tests_data/delete-revprops.expected.dump,
* svnsync_tests_data/delete-revprops.dump
New test data files.
Added:
subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump
subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump
Modified:
subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests.py?rev=1021493&r1=1021492&r2=1021493&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Mon Oct 11 20:15:54 2010
@@ -136,21 +136,14 @@ def run_info(url, expected_error=None):
raise SVNUnexpectedStdout("Missing stdout")
-def run_test(sbox, dump_file_name, subdir = None, exp_dump_file_name = None):
- """Load a dump file, sync repositories, and compare contents with the original
-or another dump file."""
+def setup_and_sync(sbox, dump_file_contents, subdir=None):
+ """Create a repository for SBOX, load it with DUMP_FILE_CONTENTS, then create a mirror repository and sync it with SBOX. Return the mirror sandbox."""
# Create the empty master repository.
build_repos(sbox)
- # This directory contains all the dump files
- svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
- 'svnsync_tests_data')
- # Load the specified dump file into the master repository.
- master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
- dump_file_name),
- 'rb').readlines()
- svntest.actions.run_and_verify_load(sbox.repo_dir, master_dumpfile_contents)
+ # Load the repository from DUMP_FILE_PATH.
+ svntest.actions.run_and_verify_load(sbox.repo_dir, dump_file_contents)
# Create the empty destination repository.
dest_sbox = sbox.clone_dependent()
@@ -173,6 +166,11 @@ or another dump file."""
run_sync(dest_sbox.repo_url, repo_url)
run_copy_revprops(dest_sbox.repo_url, repo_url)
+ return dest_sbox
+
+def verify_mirror(dest_sbox, exp_dump_file_contents):
+ """Compare the contents of the DEST_SBOX repository with EXP_DUMP_FILE_CONTENTS."""
+
# Remove some SVNSync-specific housekeeping properties from the
# mirror repository in preparation for the comparison dump.
for prop_name in ("svn:sync-from-url", "svn:sync-from-uuid",
@@ -184,6 +182,24 @@ or another dump file."""
# Create a dump file from the mirror repository.
dest_dump = svntest.actions.run_and_verify_dump(dest_sbox.repo_dir)
+ svntest.verify.compare_and_display_lines(
+ "Dump files", "DUMP", exp_dump_file_contents, dest_dump)
+
+def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None):
+ """Load a dump file, sync repositories, and compare contents with the original
+or another dump file."""
+
+ # This directory contains all the dump files
+ svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'svnsync_tests_data')
+
+ # Load the specified dump file into the master repository.
+ master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
+ dump_file_name),
+ 'rb').readlines()
+
+ dest_sbox = setup_and_sync(sbox, master_dumpfile_contents, subdir)
+
# Compare the dump produced by the mirror repository with either the original
# dump file (used to create the master repository) or another specified dump
# file.
@@ -193,8 +209,8 @@ or another dump file."""
else:
exp_master_dumpfile_contents = master_dumpfile_contents
- svntest.verify.compare_and_display_lines(
- "Dump files", "DUMP", exp_master_dumpfile_contents, dest_dump)
+ verify_mirror(dest_sbox, exp_master_dumpfile_contents)
+
######################################################################
@@ -781,6 +797,37 @@ def descend_into_replace(sbox):
run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
exp_dump_file_name = "descend_into_replace.expected.dump")
+# issue #3728
+def delete_revprops(sbox):
+ "copy-revprops with removals"
+ svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'svnsync_tests_data')
+ initial_contents = open(os.path.join(svnsync_tests_dir,
+ "delete-revprops.dump"),
+ 'rb').readlines()
+ expected_contents = open(os.path.join(svnsync_tests_dir,
+ "delete-revprops.expected.dump"),
+ 'rb').readlines()
+
+ # Create the initial repos and mirror, and sync 'em.
+ dest_sbox = setup_and_sync(sbox, initial_contents)
+
+ # Now remove a revprop from r1 of the source, and run 'svnsync
+ # copy-revprops' to re-sync 'em.
+ svntest.actions.enable_revprop_changes(sbox.repo_dir)
+ exit_code, out, err = svntest.main.run_svn(None,
+ 'pdel',
+ '-r', '1',
+ '--revprop',
+ 'issue-id',
+ sbox.repo_url)
+ if err:
+ raise SVNUnexpectedStderr(err)
+ run_copy_revprops(dest_sbox.repo_url, sbox.repo_url)
+
+ # Does the result look as we expected?
+ verify_mirror(dest_sbox, expected_contents)
+
########################################################################
# Run the tests
@@ -821,6 +868,7 @@ test_list = [ None,
delete_svn_props,
commit_a_copy_of_root,
descend_into_replace,
+ XFail(delete_revprops),
]
if __name__ == '__main__':
Added: subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump?rev=1021493&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump (added)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump Mon Oct 11 20:15:54 2010
@@ -0,0 +1,45 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 8e4a7212-d56e-11df-8ee9-37196cd04bc1
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2010-10-11T19:34:25.487865Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 136
+Content-length: 136
+
+K 8
+issue-id
+V 4
+1729
+K 10
+svn:author
+V 8
+cmpilato
+K 8
+svn:date
+V 27
+2010-10-11T19:55:50.912266Z
+K 7
+svn:log
+V 11
+Create dir1
+PROPS-END
+
+Node-path: dir1
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
Added: subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump?rev=1021493&view=auto
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump (added)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump Mon Oct 11 20:15:54 2010
@@ -0,0 +1,41 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 8e4a7212-d56e-11df-8ee9-37196cd04bc1
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2010-10-11T19:34:25.487865Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 114
+Content-length: 114
+
+K 10
+svn:author
+V 8
+cmpilato
+K 8
+svn:date
+V 27
+2010-10-11T19:55:50.912266Z
+K 7
+svn:log
+V 11
+Create dir1
+PROPS-END
+
+Node-path: dir1
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+