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/02/13 18:15:13 UTC

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

Author: stsp
Date: Wed Feb 13 17:15:12 2013
New Revision: 1445758

URL: http://svn.apache.org/r1445758
Log:
On the 1.7.x-issue3741 branch, merge r1445753, resolving minor text conflicts.

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

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

Modified: subversion/branches/1.7.x-issue3741/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue3741/subversion/libsvn_client/update.c?rev=1445758&r1=1445757&r2=1445758&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue3741/subversion/libsvn_client/update.c (original)
+++ subversion/branches/1.7.x-issue3741/subversion/libsvn_client/update.c Wed Feb 13 17:15:12 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-issue3741/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue3741/subversion/tests/cmdline/externals_tests.py?rev=1445758&r1=1445757&r2=1445758&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue3741/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/1.7.x-issue3741/subversion/tests/cmdline/externals_tests.py Wed Feb 13 17:15:12 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__':