subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1330512 - in /subversion/branches/1.7.x-issue4166: ./ subversion/libsvn_client/merge.c subversion/tests/cmdline/merge_tests.py
Date Wed, 25 Apr 2012 19:40:30 GMT
Author: pburba
Date: Wed Apr 25 19:40:29 2012
New Revision: 1330512

URL: http://svn.apache.org/viewvc?rev=1330512&view=rev
Log:
On the 1.7.x-issue4166 backport branch: Merge r1329417 from trunk.

* subversion/libsvn_client/merge.c
  (notification_receiver): Fix a minor compilation error.

* subversion/tests/cmdline/merge_tests.py
  Clean merge.

Modified:
    subversion/branches/1.7.x-issue4166/   (props changed)
    subversion/branches/1.7.x-issue4166/subversion/libsvn_client/merge.c
    subversion/branches/1.7.x-issue4166/subversion/tests/cmdline/merge_tests.py

Propchange: subversion/branches/1.7.x-issue4166/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1329417

Modified: subversion/branches/1.7.x-issue4166/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4166/subversion/libsvn_client/merge.c?rev=1330512&r1=1330511&r2=1330512&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4166/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.7.x-issue4166/subversion/libsvn_client/merge.c Wed Apr 25 19:40:29
2012
@@ -2655,6 +2655,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->path,
+                       APR_HASH_KEY_STRING, NULL);
+        }
     }
 
   /* If our merge sources are ancestors of one another... */

Modified: subversion/branches/1.7.x-issue4166/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4166/subversion/tests/cmdline/merge_tests.py?rev=1330512&r1=1330511&r2=1330512&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4166/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.7.x-issue4166/subversion/tests/cmdline/merge_tests.py Wed Apr 25
19:40:29 2012
@@ -17193,6 +17193,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
 
@@ -17322,6 +17392,7 @@ test_list = [ None,
               merge_adds_subtree_with_mergeinfo,
               record_only_merge_adds_new_subtree_mergeinfo,
               reverse_merge_with_rename,
+              merge_adds_then_deletes_subtree,
              ]
 
 if __name__ == '__main__':



Mime
View raw message