subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1329417 - in /subversion/trunk/subversion: libsvn_client/merge.c tests/cmdline/merge_tests.py
Date Mon, 23 Apr 2012 20:13:19 GMT
Author: pburba
Date: Mon Apr 23 20:13:19 2012
New Revision: 1329417

URL: http://svn.apache.org/viewvc?rev=1329417&view=rev
Log:
Fix issue #4166 'multiple merge editor drives which add then delete a
subtree fail'.

* subversion/libsvn_client/merge.c
  (notification_receiver): If we delete a path a previous editor drive added
   then remove that path from our hash of added paths, since we don't want to
   attempt to record mergeinfo on that deleted path.

* subversion/tests/cmdline/merge_tests.py
  (merge_adds_then_deletes_subtree): New test.
  (test_list): Add merge_adds_then_deletes_subtree.

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=1329417&r1=1329416&r2=1329417&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Apr 23 20:13:19 2012
@@ -2966,6 +2966,16 @@ notification_receiver(void *baton, const
             apr_hash_set(notify_b->added_abspaths, added_path,
                          APR_HASH_KEY_STRING, added_path);
         }
+
+      if (notify->action == svn_wc_notify_update_delete
+          && notify_b->added_abspaths)
+        {
+          /* Issue #4166: If a previous merge added NOTIFY_ABSPATH, but we
+             are now deleting it, then remove it from the list of added
+             paths. */
+          apr_hash_set(notify_b->added_abspaths, notify_abspath,
+                       APR_HASH_KEY_STRING, NULL);
+        }
     }
 
   /* Notify that a merge is beginning, if we haven't already done so.

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1329417&r1=1329416&r2=1329417&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Mon Apr 23 20:13:19 2012
@@ -17550,6 +17550,76 @@ def reverse_merge_with_rename(sbox):
                                      'merge', sbox.repo_url + '/trunk',
                                      A_COPY_path, '-r9:1')
 
+#----------------------------------------------------------------------
+# Test for issue #4166 'multiple merge editor drives which add then
+# delete a subtree fail'.
+@SkipUnless(server_has_mergeinfo)
+@Issue(4166)
+def merge_adds_then_deletes_subtree(sbox):
+  "merge adds then deletes subtree"
+
+  # Some paths we'll care about.
+  A_path         = os.path.join(sbox.wc_dir, 'A')
+  nu_path        = os.path.join(sbox.wc_dir, 'A', 'C', 'nu')
+  C_branch_path  = os.path.join(sbox.wc_dir, 'branch', 'C')
+  nu_branch_path = os.path.join(sbox.wc_dir, 'branch', 'C', 'nu')
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Make a branch.
+  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
+                                     sbox.repo_url + '/A',
+                                     sbox.repo_url + '/branch',
+                                     '-m', 'Make a branch.')
+
+  # On the branch parent: Add a file in r3 and then delete it in r4.
+  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
+  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
+                                     '-m', 'Add a file')
+  svntest.actions.run_and_verify_svn(None, None, [], 'delete', nu_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
+                                     '-m', 'Delete a file')
+
+  # Merge r3 and r4 from ^/A/C to branch/C as part of one merge
+  # command, but as separate editor drives, i.e. 'c3,4 vs. -r2:4.
+  # These should be equivalent but the former was failing with:
+  #
+  #   >svn merge ^/A/C branch\C -c3,4
+  #   --- Merging r3 into 'branch\C':
+  #   A    branch\C\nu
+  #   --- Recording mergeinfo for merge of r3 into 'branch\C':
+  #    U   branch\C
+  #   --- Merging r4 into 'branch\C':
+  #   D    branch\C\nu
+  #   --- Recording mergeinfo for merge of r4 into 'branch\C':
+  #    G   branch\C
+  #   ..\..\..\subversion\svn\util.c:913: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\merge.c:10873: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\merge.c:10837: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\merge.c:8994: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\merge.c:7923: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\mergeinfo.c:257: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_client\mergeinfo.c:97: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_wc\props.c:2003: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_wc\props.c:2024: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_wc\wc_db.c:11473: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_wc\wc_db.c:7247: (apr_err=155010)
+  #   ..\..\..\subversion\libsvn_wc\wc_db.c:7232: (apr_err=155010)
+  #   svn: E155010: The node 'C:\SVN\src-trunk\Debug\subversion\tests
+  #   \cmdline\svn-test-work\working_copies\merge_tests-128\branch\C\nu'
+  #   was not found.
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  svntest.actions.run_and_verify_svn(
+    None,
+    expected_merge_output([[3],[4]],
+                          ['A    ' + nu_branch_path + '\n',
+                           'D    ' + nu_branch_path + '\n',
+                           ' U   ' + C_branch_path + '\n',
+                           ' G   ' + C_branch_path + '\n',]),
+    [], 'merge', '-c3,4', sbox.repo_url + '/A/C', C_branch_path)
+
 ########################################################################
 # Run the tests
 
@@ -17683,6 +17753,7 @@ test_list = [ None,
               svnmucc_abuse_1,
               merge_source_with_replacement,
               reverse_merge_with_rename,
+              merge_adds_then_deletes_subtree,
              ]
 
 if __name__ == '__main__':



Mime
View raw message