You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2018/11/28 04:00:30 UTC

svn commit: r1847610 - in /subversion/branches/1.11.x: ./ STATUS subversion/libsvn_client/copy.c subversion/tests/cmdline/copy_tests.py

Author: svn-role
Date: Wed Nov 28 04:00:29 2018
New Revision: 1847610

URL: http://svn.apache.org/viewvc?rev=1847610&view=rev
Log:
Merge the r1847181 group from trunk:

 * r1847181, r1847182, r1847188, r1847264
   Fix issue SVN-4792: Foreign repo copy of file adding mergeinfo.
   Justification:
     We don't want bogus mergeinfo.
   Votes:
     +1: julianfoad, brane, rhuijben

Modified:
    subversion/branches/1.11.x/   (props changed)
    subversion/branches/1.11.x/STATUS
    subversion/branches/1.11.x/subversion/libsvn_client/copy.c
    subversion/branches/1.11.x/subversion/tests/cmdline/copy_tests.py

Propchange: subversion/branches/1.11.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 28 04:00:29 2018
@@ -100,4 +100,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841719,1841725,1841731,1841736,1841742-1841743,1841753-1841754,1841822,1841850,1841867,1842090,1842222-1842223,1842334,1842814,1842827,1842829,1842877,1843888,1844882,1844987,1845204,1845261,1845408,1845555-1845556,1845559,1845577,1846299,1846403,1846406,1846704
+/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841719,1841725,1841731,1841736,1841742-1841743,1841753-1841754,1841822,1841850,1841867,1842090,1842222-1842223,1842334,1842814,1842827,1842829,1842877,1843888,1844882,1844987,1845204,1845261,1845408,1845555-1845556,1845559,1845577,1846299,1846403,1846406,1846704,1847181-1847182,1847188,1847264

Modified: subversion/branches/1.11.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/STATUS?rev=1847610&r1=1847609&r2=1847610&view=diff
==============================================================================
--- subversion/branches/1.11.x/STATUS (original)
+++ subversion/branches/1.11.x/STATUS Wed Nov 28 04:00:29 2018
@@ -35,10 +35,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1847181, r1847182, r1847188, r1847264
-   Fix issue SVN-4792: Foreign repo copy of file adding mergeinfo.
-   Justification:
-     We don't want bogus mergeinfo.
-   Votes:
-     +1: julianfoad, brane, rhuijben

Modified: subversion/branches/1.11.x/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/libsvn_client/copy.c?rev=1847610&r1=1847609&r2=1847610&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/1.11.x/subversion/libsvn_client/copy.c Wed Nov 28 04:00:29 2018
@@ -2550,13 +2550,18 @@ repos_to_wc_copy_single(svn_boolean_t *t
          pool));
     }
 
-  /* Record the implied mergeinfo (before the notification callback
-     is invoked for the root node). */
-  SVN_ERR(svn_client__get_repos_mergeinfo(
-            &src_mergeinfo, ra_session,
-            pair->src_abspath_or_url, pair->src_revnum,
-            svn_mergeinfo_inherited, TRUE /*squelch_incapable*/, pool));
-  SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
+  if (same_repositories)
+    {
+      /* Record the implied mergeinfo (before the notification callback
+         is invoked for the root node). */
+      SVN_ERR(svn_client__get_repos_mergeinfo(&src_mergeinfo, ra_session,
+                                              pair->src_abspath_or_url,
+                                              pair->src_revnum,
+                                              svn_mergeinfo_inherited,
+                                              TRUE /*squelch_incapable*/,
+                                              pool));
+      SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
+    }
 
   /* Do our own notification for the root node, even if we could possibly
      have delegated it.  See also issue #1552.

Modified: subversion/branches/1.11.x/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/tests/cmdline/copy_tests.py?rev=1847610&r1=1847609&r2=1847610&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/1.11.x/subversion/tests/cmdline/copy_tests.py Wed Nov 28 04:00:29 2018
@@ -1032,43 +1032,63 @@ def foreign_repos_to_wc(sbox):
                          repo_url + '/' + source,
                          repo_url + '/' + dest)
 
+  # Scenarios:
+  # (parent-path-under-'A/', base-name, child-paths, mergeinfo-inheritance)
+  scenarios = [
+    ('B',   'E',   ['alpha','beta'], 'explicit'),
+    ('B',   'F',   [],               'inherited'),
+    ('D/G', 'pi',  [],               'explicit'),
+    ('D/G', 'rho', [],               'inherited'),
+  ]
+
+  # Add some mergeinfo, which should be discarded by a foreign repo copy.
+  # On each path of interest, add either explicit or inherited mergeinfo:
+  # the implementation handles these cases differently.
+  # (We commit these initially in the original repo just for convenience: as
+  # we already have a WC. Really they only need to be in the 'other' repo.)
+  for parent, name, children, mi_inheritance in scenarios:
+    if mi_inheritance == 'explicit':
+      sbox.simple_propset(SVN_PROP_MERGEINFO,
+                          '/branch/' + name + ':1', 'A/' + parent + '/' + name)
+    else:
+      sbox.simple_propset(SVN_PROP_MERGEINFO,
+                          '/branch/' + name + ':1', 'A/' + parent)
+  sbox.simple_commit()
+
   # We have a standard repository and working copy.  Now we create a
   # second repository with the same greek tree, but different UUID.
   repo_dir       = sbox.repo_dir
   other_repo_dir, other_repo_url = sbox.add_repo_path('other')
-  svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 1)
+  svntest.main.copy_repos(repo_dir, other_repo_dir, 2, 1)
   move_url(other_repo_url, 'A', 'A2')
   move_url(other_repo_url, 'A2', 'A3')
 
   # URL->wc copy:
   # copy a file and a directory from a foreign repository.
   # we should get some scheduled additions *without history*.
-  E_url = other_repo_url + "/A2/B/E"
-  pi_url = other_repo_url + "/A2/D/G/pi"
-  peg_rev = '2'
-  op_rev = '1'
-  E_url_resolved = E_url.replace('/A2/', '/A/')
-  pi_url_resolved = pi_url.replace('/A2/', '/A/')
-
-  expected_output = svntest.verify.UnorderedOutput([
-    '--- Copying from foreign repository URL \'%s\':\n' % E_url_resolved,
-    'A         %s\n' % sbox.ospath('E'),
-    'A         %s\n' % sbox.ospath('E/beta'),
-    'A         %s\n' % sbox.ospath('E/alpha'),
-  ])
-  svntest.actions.run_and_verify_svn(expected_output, [],
-                                     'copy', '-r' + op_rev,
-                                     E_url + '@' + peg_rev,
-                                     wc_dir)
-
-  expected_output = [
-    '--- Copying from foreign repository URL \'%s\':\n' % pi_url_resolved,
-    'A         %s\n' % sbox.ospath('pi'),
-  ]
-  svntest.actions.run_and_verify_svn(expected_output, [],
-                                     'copy', '-r' + op_rev,
-                                     pi_url + '@' + peg_rev,
-                                     wc_dir)
+  peg_rev = '3'
+  op_rev = '2'
+
+  for parent, name, children, mi_inheritance in scenarios:
+    src_url = other_repo_url + '/A2/' + parent + '/' + name
+    src_url_resolved = src_url.replace('/A2/', '/A/')
+
+    expected_output = svntest.verify.UnorderedOutput([
+      '--- Copying from foreign repository URL \'%s\':\n' % src_url_resolved,
+      'A         %s\n' % sbox.ospath(name),
+    ] + [
+      'A         %s\n' % sbox.ospath(name + '/' + child)
+      for child in children
+    ])
+    svntest.actions.run_and_verify_svn(expected_output, [],
+                                       'copy', '-r' + op_rev,
+                                       src_url + '@' + peg_rev,
+                                       wc_dir)
+
+    # Validate the mergeinfo of the copy destination (we expect none)
+    svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
+                                       'propget', SVN_PROP_MERGEINFO,
+                                       sbox.ospath(name))
 
 #----------------------------------------------------------------------
 # Issue 1084: ra_svn move/copy bug