You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/05/22 22:01:06 UTC

svn commit: r1485384 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_client/update.c subversion/tests/cmdline/externals_tests.py

Author: stsp
Date: Wed May 22 20:01:05 2013
New Revision: 1485384

URL: http://svn.apache.org/r1485384
Log:
On the 1.7.x branch, merge r1445753 from trunk, resolving conflicts.

* subversion/tests/cmdline/externals_tests.py: Add only the new test
   for issue #3741 (update_dir_external_shallow), not unrelated tests
   which are new on trunk and added during the merge.

 * r1445753
   Fix issue #3741, 'externals not removed when working copy is made shallow'.
   Justification:
     Externals linger after update --set-depth empty, causing unnecessary
     tree conflicts when the working copy is updated back to depth infinity.
     See regression test and also the recipe script attached to issue #3741.
   Votes:
     +1: stsp, rhuijben, breser
     -0: danielsh (merge conflicts)


Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_client/update.c
    subversion/branches/1.7.x/subversion/tests/cmdline/externals_tests.py

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

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1485384&r1=1485383&r2=1485384&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed May 22 20:01:05 2013
@@ -181,14 +181,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1445753
-   Fix issue #3741, 'externals not removed when working copy is made shallow'.
-   Justification:
-     Externals linger after update --set-depth empty, causing unnecessary
-     tree conflicts when the working copy is updated back to depth infinity.
-     See regression test and also the recipe script attached to issue #3741.
-   Votes:
-     +1: stsp, rhuijben, breser
-     -0: danielsh (merge conflicts)
-

Modified: subversion/branches/1.7.x/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_client/update.c?rev=1485384&r1=1485383&r2=1485384&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_client/update.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_client/update.c Wed May 22 20:01:05 2013
@@ -209,6 +209,7 @@ update_internal(svn_revnum_t *result_rev
   struct svn_client__dirent_fetcher_baton_t dfb;
   svn_boolean_t server_supports_depth;
   svn_boolean_t tree_conflicted;
+  svn_boolean_t cropping_target;
   svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
                                                  SVN_CONFIG_CATEGORY_CONFIG,
                                                  APR_HASH_KEY_STRING) : NULL;
@@ -268,7 +269,8 @@ update_internal(svn_revnum_t *result_rev
     }
 
   /* We may need to crop the tree if the depth is sticky */
-  if (depth_is_sticky && depth < svn_depth_infinity)
+  cropping_target = (depth_is_sticky && depth < svn_depth_infinity);
+  if (cropping_target)
     {
       svn_node_kind_t target_kind;
 
@@ -421,7 +423,8 @@ update_internal(svn_revnum_t *result_rev
   /* We handle externals after the update is complete, so that
      handling external items (and any errors therefrom) doesn't delay
      the primary operation.  */
-  if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals))
+  if ((SVN_DEPTH_IS_RECURSIVE(depth) || cropping_target)
+      && (! ignore_externals))
     {
       apr_hash_t *new_externals;
       apr_hash_t *new_depths;

Modified: subversion/branches/1.7.x/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/externals_tests.py?rev=1485384&r1=1485383&r2=1485384&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/1.7.x/subversion/tests/cmdline/externals_tests.py Wed May 22 20:01:05 2013
@@ -2309,6 +2309,45 @@ def url_to_wc_copy_of_externals(sbox):
     "OUTPUT", expected_stdout, [], 0, 'copy', repo_url + '/A/C',
     os.path.join(wc_dir, 'External-WC-to-URL-Copy'))
 
+# Test for issue #3741 'externals not removed when working copy is made shallow'
+@Issue(3741)
+def update_dir_external_shallow(sbox):
+  "shallow update should remove externals"
+
+  sbox.build()
+
+  # Create an external in r2
+  sbox.simple_propset('svn:externals', '^/A/D/H X', 'A/B/E')
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # Now make A/B/E shallow by updating with "--set-depth empty"
+  expected_output = svntest.wc.State(sbox.wc_dir, {
+    'A/B/E/alpha' : Item(status='D '),
+    'A/B/E/X'     : Item(verb='Removed external'),
+    'A/B/E/beta'  : Item(status='D '),
+  })
+  svntest.actions.run_and_verify_update(sbox.wc_dir,
+                                        expected_output, None, None,
+                                        None, None, None, None, None, False,
+                                        '--set-depth=empty',
+                                        sbox.ospath('A/B/E'))
+
+  # And bring the external back by updating with "--set-depth infinity"
+  expected_output = svntest.wc.State(sbox.wc_dir, {
+    'A/B/E/X/psi'   : Item(status='A '),
+    'A/B/E/X/chi'   : Item(status='A '),
+    'A/B/E/X/omega' : Item(status='A '),
+    'A/B/E/alpha'   : Item(status='A '),
+    'A/B/E/beta'    : Item(status='A '),
+  })
+  svntest.actions.run_and_verify_update(sbox.wc_dir,
+                                        expected_output, None, None,
+                                        None, None, None, None, None, False,
+                                        '--set-depth=infinity',
+                                        sbox.ospath('A/B/E'))
+
+
 ########################################################################
 # Run the tests
 
@@ -2353,6 +2392,7 @@ test_list = [ None,
               remap_file_external_with_prop_del,
               dir_external_with_dash_r_only,
               url_to_wc_copy_of_externals,
+              update_dir_external_shallow,
              ]
 
 if __name__ == '__main__':