You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2013/01/30 22:32:39 UTC

svn commit: r1440682 - in /subversion/trunk/subversion: libsvn_client/merge.c tests/cmdline/merge_tests.py

Author: pburba
Date: Wed Jan 30 21:32:38 2013
New Revision: 1440682

URL: http://svn.apache.org/viewvc?rev=1440682&view=rev
Log:
Stop producing duplicate mergeinfo notifications when a merge adds a
subtree with explicit mergeinfo on it.

* subversion/libsvn_client/merge.c

  (record_mergeinfo_for_dir_merge): If we already recorded mergeinfo for a
   subtree remove that subtree from the hash we'll later pass to
   record_mergeinfo_for_added_subtrees(), since that function will
   effectively do the same thing, resulting in two mergeinfo notifications
   for the same path. 

* subversion/tests/cmdline/merge_tests.py

  (no_self_referential_filtering_on_added_path): Don't expect duplicate
   mergeinfo notifications.  Add a note referencing issue #4309 which is
   evident here.

  (merge_adds_subtree_with_mergeinfo): Don't expect duplicate
   mergeinfo notifications. 

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/tests/cmdline/merge_tests.py

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1440682&r1=1440681&r2=1440682&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Jan 30 21:32:38 2013
@@ -8108,6 +8108,13 @@ record_mergeinfo_for_dir_merge(svn_merge
                                       child_merge_src_fspath,
                                       child_merges, is_rollback,
                                       merge_b->ctx, iterpool));
+
+          /* Once is enough: We don't need to record mergeinfo describing
+             the merge a second.  If CHILD->ABSPATH is in
+             MERGE_B->ADDED_ABSPATHS, we'll do just that, so remove the
+             former from the latter. */
+          apr_hash_set(merge_b->added_abspaths, child->abspath,
+                       APR_HASH_KEY_STRING, NULL);
         }
 
       /* Elide explicit subtree mergeinfo whether or not we updated it. */

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1440682&r1=1440681&r2=1440682&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Wed Jan 30 21:32:38 2013
@@ -13954,9 +13954,17 @@ def no_self_referential_filtering_on_add
     'C'         : Item(status='D '),
     'C_MOVED'   : Item(status='A '),
     })
+  # Why is C_MOVED notified as ' G' rather than ' U'?  C_MOVED was
+  # added by the merge and there is only a single editor drive, so
+  # how can any prop changes be merged to it?  The answer is that
+  # the merge code does some quiet housekeeping, merging C_MOVED's
+  # inherited mergeinfo into its incoming mergeinfo, see
+  # http://subversion.tigris.org/issues/show_bug.cgi?id=4309
+  # This test is not covering issue #4309 so we let the current
+  # behavior pass.
   expected_mergeinfo_output = wc.State(A_COPY_2_path, {
     ''        : Item(status=' G'),
-    'C_MOVED' : Item(status=' G', prev_status=' G'),
+    'C_MOVED' : Item(status=' G'),
     })
   expected_elision_output = wc.State(A_COPY_2_path, {
     })
@@ -13991,6 +13999,7 @@ def no_self_referential_filtering_on_add
     'B/E/beta'  : Item("New content"),
     'B/lambda'  : Item("This is the file 'lambda'.\n"),
     'B/F'       : Item(),
+  # What's up with the mergeinfo
     'C_MOVED'   : Item(props={SVN_PROP_MERGEINFO : '/A/C_MOVED:10\n' +
                               '/A_COPY/C:8\n' +
                               '/A_COPY/C_MOVED:8',
@@ -16804,7 +16813,7 @@ def merge_adds_subtree_with_mergeinfo(sb
     })
   expected_mergeinfo_output = wc.State(A_COPY2_path, {
     ''     : Item(status=' G'),
-    'C/nu' : Item(status=' G', prev_status=' U'),
+    'C/nu' : Item(status=' U'),
     })
   expected_elision_output = wc.State(A_COPY2_path, {
     })