subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1401937 - in /subversion/branches/1.7.x-r1401915: ./ subversion/libsvn_client/merge.c subversion/tests/cmdline/merge_tests.py
Date Thu, 25 Oct 2012 00:50:00 GMT
Author: pburba
Date: Thu Oct 25 00:50:00 2012
New Revision: 1401937

URL: http://svn.apache.org/viewvc?rev=1401937&view=rev
Log:
On the 1.7.x-r1401915 branch: Merge r1401915 from ^/subversion/trunk.

* src-branch-1.7.x
  Mergeinfo changes only.

* subversion/libsvn_client/merge.c
  (merge_reintegrate_locked): Rework to account for refactoring on trunk.

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

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

Propchange: subversion/branches/1.7.x-r1401915/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1401915

Modified: subversion/branches/1.7.x-r1401915/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1401915/subversion/libsvn_client/merge.c?rev=1401937&r1=1401936&r2=1401937&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1401915/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.7.x-r1401915/subversion/libsvn_client/merge.c Thu Oct 25 00:50:00
2012
@@ -10577,6 +10577,32 @@ merge_reintegrate_locked(const char *sou
                               &working_revision, NULL, svn_depth_infinity,
                               NULL, ctx, scratch_pool, scratch_pool));
 
+  if (apr_hash_count(subtrees_with_mergeinfo))
+    {
+      apr_hash_t *externals;
+      apr_hash_index_t *hi;
+
+      SVN_ERR(svn_wc__externals_defined_below(&externals, ctx->wc_ctx,
+                                              target_abspath, scratch_pool,
+                                              scratch_pool));
+
+      for (hi = apr_hash_first(scratch_pool, subtrees_with_mergeinfo);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          const char *wc_path = svn__apr_hash_index_key(hi);
+
+          /* svn_client_propget4 picks up file externals with
+             mergeinfo, but we don't want those. */
+          if (apr_hash_get(externals, wc_path, APR_HASH_KEY_STRING))
+            {
+              apr_hash_set(subtrees_with_mergeinfo, wc_path,
+                           APR_HASH_KEY_STRING, NULL);
+              continue;
+            }
+        }
+    }
+
   /* Open two RA sessions, one to our source and one to our target. */
   no_rev.kind = svn_opt_revision_unspecified;
   SVN_ERR(svn_client__ra_session_from_path(&source_ra_session, &rev2, &url2,

Modified: subversion/branches/1.7.x-r1401915/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1401915/subversion/tests/cmdline/merge_tests.py?rev=1401937&r1=1401936&r2=1401937&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1401915/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.7.x-r1401915/subversion/tests/cmdline/merge_tests.py Thu Oct 25
00:50:00 2012
@@ -17438,6 +17438,60 @@ def merge_with_added_subtrees_with_merge
                                        None, None, None, None,
                                        None, 1, 0)
 
+#----------------------------------------------------------------------
+@SkipUnless(server_has_mergeinfo)
+def merge_with_externals_with_mergeinfo(sbox):
+  "merge with externals with mergeinfo"
+
+  # Some paths we'll care about.
+  A_path = sbox.ospath('A')
+  A_COPY_path = sbox.ospath('A_COPY')
+  file_external_path = sbox.ospath('A/file-external')
+  mu_COPY_path = sbox.ospath('A_COPY/mu')
+  mu_path = sbox.ospath('A/mu')
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Make a branch of ^/A and then make a few edits under A in r3-6:
+  wc_disk, wc_status = set_up_branch(sbox)
+
+  svntest.main.file_write(mu_COPY_path, "branch edit")
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'file edit on the branch', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Create a file external under 'A' and set some bogus mergeinfo
+  # on it (the fact that this mergeinfo is bogus has no bearing on
+  # this test).
+  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
+                                     'svn:externals',
+                                     '^/iota file-external', A_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'set file external', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
+                                     "/bogus-mergeinfo:5", file_external_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'set mergeinfo on file external',
+                                     file_external_path)
+
+  # Sync merge ^/A to A_COPY and then reintegrate A_COPY back to A.
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
+                                     sbox.repo_url + '/A', A_COPY_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'sync merge', wc_dir)
+  # This was segfaulting, see
+  # http://svn.haxx.se/dev/archive-2012-10/0364.shtml
+  svntest.actions.run_and_verify_svn(
+    None,
+    expected_merge_output(None,
+                          ['U    ' + mu_path + '\n',
+                           ' U   ' + A_path  + '\n'],
+                          two_url=True),
+    [], 'merge', '--reintegrate', sbox.repo_url + '/A_COPY',
+    A_path)
+
 ########################################################################
 # Run the tests
 
@@ -17569,6 +17623,7 @@ test_list = [ None,
               reverse_merge_with_rename,
               merge_adds_then_deletes_subtree,
               merge_with_added_subtrees_with_mergeinfo,
+              merge_with_externals_with_mergeinfo,
              ]
 
 if __name__ == '__main__':



Mime
View raw message