You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/03/26 15:24:12 UTC

svn commit: r927865 - in /subversion/branches/1.6.x: ./ CHANGES STATUS subversion/libsvn_client/switch.c subversion/tests/cmdline/externals_tests.py

Author: hwright
Date: Fri Mar 26 14:24:12 2010
New Revision: 927865

URL: http://svn.apache.org/viewvc?rev=927865&view=rev
Log:
Reintegrate the 1.6.x-issue3390 branch:

 * r877016, r902093
   Fix issue #3390 'relative externals not updated during switch'.
   Justification:
     One of the selling points of relative externals was their ability
     to be used to span branches and tags.  Not so useful if switching
     to a different tag or branch doesn't actually cause the external
     to point to the right place.
   Branch:
     ^/subversion/branches/1.6.x-issue3390
   Votes:
     +1: cmpilato, stsp, pburba

Modified:
    subversion/branches/1.6.x/   (props changed)
    subversion/branches/1.6.x/CHANGES   (props changed)
    subversion/branches/1.6.x/STATUS
    subversion/branches/1.6.x/subversion/libsvn_client/switch.c
    subversion/branches/1.6.x/subversion/tests/cmdline/externals_tests.py

Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 26 14:24:12 2010
@@ -4,6 +4,7 @@
 /subversion/branches/1.6.x-dirent-basename:872475-872607
 /subversion/branches/1.6.x-future-proof:880259-884209
 /subversion/branches/1.6.x-issue-3242-partial:916088-923778
+/subversion/branches/1.6.x-issue3390:907042-927863
 /subversion/branches/1.6.x-issue3432:878598-924025
 /subversion/branches/1.6.x-issue3443:874942-875825
 /subversion/branches/1.6.x-issue3519:880376-889934
@@ -64,4 +65,4 @@
 /subversion/branches/tc_url_rev:870696-870828
 /subversion/branches/tree-conflicts:864636-869499
 /subversion/branches/tree-conflicts-notify:870271-870353
-/subversion/trunk:875976,875980-875981,876054-876056,876092,876175,876299,876306,876427,876440,876450,876507,876571,876862,877203,877595,877597,877665,878216,878269,878321,878341,878343,878399,878423,878426,879093,879688,880274-880275,880370,880450,880474,880525-880526,880552,881905,884842,886164,886197,888715,888979,889081,889840,891672,892050,892085,895514,895653,896522,896915,898963,899826,899828,900797,901752,904301,904394,904594,905303,905326,906256,906305,917640,918211,922516
+/subversion/trunk:875976,875980-875981,876054-876056,876092,876175,876299,876306,876427,876440,876450,876507,876571,876862,877016,877203,877595,877597,877665,878216,878269,878321,878341,878343,878399,878423,878426,879093,879688,880274-880275,880370,880450,880474,880525-880526,880552,881905,884842,886164,886197,888715,888979,889081,889840,891672,892050,892085,895514,895653,896522,896915,898963,899826,899828,900797,901752,902093,904301,904394,904594,905303,905326,906256,906305,917640,918211,922516

Propchange: subversion/branches/1.6.x/CHANGES
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 26 14:24:12 2010
@@ -4,6 +4,7 @@
 /subversion/branches/1.6.x-dirent-basename/CHANGES:872475-872607
 /subversion/branches/1.6.x-future-proof/CHANGES:880259-884209
 /subversion/branches/1.6.x-issue-3242-partial/CHANGES:916088-923778
+/subversion/branches/1.6.x-issue3390/CHANGES:907042-927863
 /subversion/branches/1.6.x-issue3432/CHANGES:878598-924025
 /subversion/branches/1.6.x-issue3443/CHANGES:874942-875825
 /subversion/branches/1.6.x-issue3519/CHANGES:880376-889934

Modified: subversion/branches/1.6.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=927865&r1=927864&r2=927865&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Fri Mar 26 14:24:12 2010
@@ -223,15 +223,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r877016, r902093
-   Fix issue #3390 'relative externals not updated during switch'.
-   Justification:
-     One of the selling points of relative externals was their ability
-     to be used to span branches and tags.  Not so useful if switching
-     to a different tag or branch doesn't actually cause the external
-     to point to the right place.
-   Branch:
-     ^/subversion/branches/1.6.x-issue3390
-   Votes:
-     +1: cmpilato, stsp, pburba

Modified: subversion/branches/1.6.x/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/switch.c?rev=927865&r1=927864&r2=927865&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/switch.c Fri Mar 26 14:24:12 2010
@@ -218,15 +218,16 @@ svn_client__switch_internal(svn_revnum_t
      PATH.  When we call reporter->finish_report, the update_editor
      will be driven by svn_repos_dir_delta2.
 
-     We pass NULL for traversal_info because this is a switch, not an
-     update, and therefore we don't want to handle any externals
-     except the ones directly affected by the switch. */
+     We pass in a traversal_info for recording all externals. It
+     shouldn't be needed for a switch if it wasn't for the relative
+     externals of type '../path'. All of those must be resolved to 
+     the new location.  */
   err = svn_wc_crawl_revisions4(path, dir_access, reporter, report_baton,
                                 TRUE, depth, (! depth_is_sticky),
                                 (! server_supports_depth),
                                 use_commit_times,
                                 ctx->notify_func2, ctx->notify_baton2,
-                                NULL, /* no traversal info */
+                                traversal_info, 
                                 pool);
 
   if (err)

Modified: subversion/branches/1.6.x/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/tests/cmdline/externals_tests.py?rev=927865&r1=927864&r2=927865&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/1.6.x/subversion/tests/cmdline/externals_tests.py Fri Mar 26 14:24:12 2010
@@ -18,6 +18,7 @@
 
 # General modules
 import sys
+import re
 import os
 import warnings
 
@@ -1198,6 +1199,51 @@ def binary_file_externals(sbox):
                                         None, None, None, None, None,
                                         True)
 
+########################################################################
+
+# Issue #3351.
+def switch_relative_external(sbox):
+  "switch a relative external"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  repo_url = sbox.repo_url
+
+  # Create a relative external in A/D on ../B
+  A_path = os.path.join(wc_dir, 'A')
+  A_copy_path = os.path.join(wc_dir, 'A_copy')
+  A_copy_url = repo_url + '/A_copy'
+  D_path = os.path.join(A_path, 'D')
+  ext_path = os.path.join(D_path, 'ext')
+  externals_prop = "../B ext\n"
+  change_external(D_path, externals_prop)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ci', '-m', 'log msg',
+                                     '--quiet', wc_dir)
+
+  # Update our working copy, and create a "branch" (A => A_copy)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up',
+                                     '--quiet', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     '--quiet', A_path, A_copy_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ci', '-m', 'log msg',
+                                     '--quiet', wc_dir)
+
+  # Okay.  We now want to switch A to A_copy, which *should* cause
+  # A/D/ext to point to the URL for A_copy/D/ext.
+  svntest.actions.run_and_verify_svn(None, None, [], 'sw',
+                                     '--quiet', A_copy_url, A_path)
+
+  expected_infos = [
+    { 'Path' : re.escape(D_path),
+      'URL' : sbox.repo_url + '/A_copy/D',
+      },
+    { 'Path' : re.escape(ext_path),
+      'URL' : sbox.repo_url + '/A_copy/B',
+      },
+    ]
+  svntest.actions.run_and_verify_info(expected_infos, D_path, ext_path)
 
 #----------------------------------------------------------------------
 
@@ -1322,6 +1368,7 @@ test_list = [ None,
               can_place_file_external_into_dir_external,
               external_into_path_with_spaces,
               binary_file_externals,
+              switch_relative_external,
               wc_repos_file_externals,
              ]