Hi,
This one turned out to be pretty easy. So easy that I'd like a second
opinion before committing. . . looks like a case of backwards arguments.
Comments?
-David
Fix issue #1109.
* subversion/libsvn_client/diff.c (do_single_file_merge) : Switch order of
property hashes in call to svn_wc_get_local_propchanges(). The diff was
being generated backwards causing add property events to look like delete
property events. This resulted in broken property merges.
* subversion/tests/clients/cmdline/merge_tests.py (imple_property_merges) :
Add test case to catch broken single file property merges.
Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 4794)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -911,7 +911,7 @@
SVN_ERR (svn_io_remove_file (tmpfile2, pool));
/* Deduce property diffs, and merge those too. */
- SVN_ERR (svn_wc_get_local_propchanges (&propchanges, props1, props2, pool));
+ SVN_ERR (svn_wc_get_local_propchanges (&propchanges, props2, props1, pool));
SVN_ERR (merge_props_changed (adm_access,
&prop_state,
Index: subversion/tests/clients/cmdline/merge_tests.py
===================================================================
--- subversion/tests/clients/cmdline/merge_tests.py (revision 4794)
+++ subversion/tests/clients/cmdline/merge_tests.py (working copy)
@@ -740,6 +740,50 @@
return 1
if svntest.actions.run_and_verify_status(wc_dir, expected_status):
return 1
+
+ # issue 1109 : single file property merge. This test performs a merge
+ # that should be a no-op (adding properties that are already present).
+ outlines, errlines = svntest.main.run_svn(None, 'revert', '--recursive',
+ wc_dir)
+
+ A_url = os.path.join(svntest.main.current_repo_url, 'A')
+ A2_url = os.path.join(svntest.main.current_repo_url, 'A2')
+
+ # Copy to make revision 5
+ outlines,errlines = svntest.main.run_svn(None, 'copy', '-m', 'fumble',
+ '--username', svntest.main.wc_author,
+ '--password', svntest.main.wc_passwd,
+ A_url, A2_url)
+ if errlines:
+ return 1
+
+ outlines, errlines = svntest.main.run_svn(None, 'switch', A2_url, wc_dir)
+
+ A_url = os.path.join(svntest.main.current_repo_url, 'A', 'B', 'E', 'alpha')
+ alpha_path = os.path.join(wc_dir, 'B', 'E', 'alpha')
+
+ outlines, errlines = svntest.main.run_svn(None, 'merge',
+ '-r', '3:4', A_url, alpha_path)
+ if errlines:
+ return 1
+
+ outlines,errlines = svntest.main.run_svn(None, 'pl', alpha_path)
+
+ if errlines:
+ return 1
+
+ saw_foo = 0
+ saw_bar = 0
+ for line in outlines:
+ if re.match("\\s*foo\\s*$", line):
+ saw_foo = 1
+ if re.match("\\s*bar\\s*$", line):
+ saw_bar = 1
+
+ if not saw_foo or not saw_bar:
+ return 1
+
+ return 0
#----------------------------------------------------------------------
def merge_one_file(sbox):
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 8 18:10:51 2003