subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r899272 - in /subversion/trunk/subversion: libsvn_wc/crop.c libsvn_wc/update_editor.c tests/cmdline/depth_tests.py
Date Thu, 14 Jan 2010 16:25:08 GMT
Author: cmpilato
Date: Thu Jan 14 16:25:08 2010
New Revision: 899272

URL: http://svn.apache.org/viewvc?rev=899272&view=rev
Log:
Make `--set-depth (empty|files|immediates) DIR' work, where DIR's depth
had already been set as `exclude'.  Only `infinity' works as of now.
Adding a test for the same.

* subversion/libsvn_wc/crop.c
  (svn_wc_crop_tree2): Check the 'base status' of the node here and
    remove the check done using `svn_wc__db_node_hidden()' as it
    marks  a node as 'hidden' if status is set as
    `svn_wc__db_status_excluded'.

* subversion/libsvn_wc/update_editor.c
  (complete_directory): Call `svn_wc__set_depth' with the requested
    depth rather than `infinity' by default.

* subversion/tests/cmdline/depth_tests.py
  (update_excluded_path_sticky_depths): New test.
  (info_excluded): Remove the locally imported module `re' and make it
    globally available.
  (test_list): Add `update_excluded_path_sticky_depths'.

Suggested by: rhuijben
Patch by: Kannan R <kannanr@collab.net>
          (Tweaked by me.)

Modified:
    subversion/trunk/subversion/libsvn_wc/crop.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/tests/cmdline/depth_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/crop.c?rev=899272&r1=899271&r2=899272&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/crop.c (original)
+++ subversion/trunk/subversion/libsvn_wc/crop.c Thu Jan 14 16:25:08 2010
@@ -335,17 +335,6 @@
       _("Can only crop a working copy with a restrictive depth"));
 
   {
-    svn_boolean_t hidden;
-    SVN_ERR(svn_wc__db_node_hidden(&hidden, db, local_abspath, scratch_pool));
-
-    if (hidden)
-      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                               _("The node '%s' was not found."),
-                               svn_dirent_local_style(local_abspath,
-                                                      scratch_pool));
-  }
-
-  {
     svn_wc__db_status_t status;
     svn_wc__db_kind_t kind;
 
@@ -360,6 +349,13 @@
       return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
         _("Can only crop directories"));
 
+    if (status == svn_wc__db_status_not_present
+        || status == svn_wc__db_status_absent)
+      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                               _("The node '%s' was not found."),
+                               svn_dirent_local_style(local_abspath,
+                                                      scratch_pool));
+
     if (status == svn_wc__db_status_deleted ||
         status == svn_wc__db_status_obstructed_delete)
       return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=899272&r1=899271&r2=899272&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Jan 14 16:25:08 2010
@@ -706,7 +706,7 @@
           else
             {
               SVN_ERR(svn_wc__set_depth(eb->db, eb->target_abspath,
-                                        svn_depth_infinity, pool));
+                                        eb->requested_depth, pool));
             }
         }
 

Modified: subversion/trunk/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/depth_tests.py?rev=899272&r1=899271&r2=899272&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/depth_tests.py Thu Jan 14 16:25:08 2010
@@ -28,6 +28,7 @@
 
 # General modules
 import os
+import re
 
 # Our testing module
 import svntest
@@ -2342,7 +2343,6 @@
   A_path = os.path.join(wc_dir, 'A')
   svntest.main.run_svn(None, 'up', '--set-depth', 'exclude', A_path)
 
-  import re
   expected_info = {
       'Path' : re.escape(A_path),
       'Repository Root' : sbox.repo_url,
@@ -2502,6 +2502,161 @@
 
   svntest.actions.run_and_verify_resolved([m, B, g], '--depth=infinity', A)
 
+def update_excluded_path_sticky_depths(sbox):
+  """set-depth from excluded to all other depths"""
+
+  ign_a, ign_b, ign_c, wc_dir = set_up_depthy_working_copies(sbox,
+                                                             infinity=True)
+  A_path = os.path.join(wc_dir, 'A')
+  B_path = os.path.join(A_path, 'B')
+
+  # Exclude the subtree 'A/B'
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'            : Item(status='D '),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.remove('A/B/lambda', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/E',
+                         'A/B/F', 'A/B')
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('A/B/lambda', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/E',
+                       'A/B/F', 'A/B')
+
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None,
+                                        '--set-depth', 'exclude', B_path)
+
+  # Update to depth 'empty' for the excluded path A/B
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'         : Item(status='A '),
+    })
+  expected_status.add({
+    'A/B'         : Item(status='  ', wc_rev=1)
+    })
+  expected_disk.add({
+    'A/B'         : Item(contents=None),
+    })
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None,
+                                        '--set-depth', 'empty', B_path)
+  verify_depth(None, "empty", B_path)
+  expected_info = {
+      'Path' : re.escape(B_path),
+      'Repository Root' : sbox.repo_url,
+      'Repository UUID' : svntest.actions.get_wc_uuid(wc_dir),
+      'Depth' : 'empty',
+  }
+  svntest.actions.run_and_verify_info([expected_info], B_path)
+
+  # Exclude A/B again
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'up', '--set-depth', 'exclude', B_path)
+
+  # Update to depth 'files' for the excluded path A/B
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'              : Item(status='A '),
+    'A/B/lambda'       : Item(status='A '),
+    })
+  expected_status.add({
+    'A/B'              : Item(status='  ', wc_rev=1),
+    'A/B/lambda'       : Item(status='  ', wc_rev=1),
+    })
+  expected_disk.add({
+    'A/B'            : Item(contents=None),
+    'A/B/lambda'     : Item(contents="This is the file 'lambda'.\n"),
+    })
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None,
+                                        '--set-depth', 'files', B_path)
+  verify_depth(None, "files", B_path)
+  expected_info = {
+      'Path' : re.escape(B_path),
+      'Repository Root' : sbox.repo_url,
+      'Repository UUID' : svntest.actions.get_wc_uuid(wc_dir),
+      'Depth' : 'files',
+  }
+  svntest.actions.run_and_verify_info([expected_info], B_path)
+
+  # Exclude A/B again
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'up', '--set-depth', 'exclude', B_path)
+
+  # Update to depth 'immediates' for the excluded path A/B
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'              : Item(status='A '),
+    'A/B/lambda'       : Item(status='A '),
+    'A/B/E'            : Item(status='A '),
+    'A/B/F'            : Item(status='A '),
+    })
+  expected_status.add({
+    'A/B'              : Item(status='  ', wc_rev=1),
+    'A/B/lambda'       : Item(status='  ', wc_rev=1),
+    'A/B/E'            : Item(status='  ', wc_rev=1),
+    'A/B/F'            : Item(status='  ', wc_rev=1),
+    })
+  expected_disk.add({
+    'A/B'              : Item(contents=None),
+    'A/B/lambda'       : Item(contents="This is the file 'lambda'.\n"),
+    'A/B/E'            : Item(contents=None),
+    'A/B/F'            : Item(contents=None),
+    })
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None,
+                                        '--set-depth', 'immediates', B_path)
+  verify_depth(None, "immediates", B_path)
+  expected_info = {
+      'Path' : re.escape(B_path),
+      'Repository Root' : sbox.repo_url,
+      'Repository UUID' : svntest.actions.get_wc_uuid(wc_dir),
+      'Depth' : 'immediates',
+  }
+  svntest.actions.run_and_verify_info([expected_info], B_path)
+
+  # Exclude A/B again
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'up', '--set-depth', 'exclude', B_path)
+
+  # Update to depth 'infinity' for the excluded path A/B
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'              : Item(status='A '),
+    'A/B/lambda'       : Item(status='A '),
+    'A/B/E'            : Item(status='A '),
+    'A/B/E/beta'       : Item(status='A '),
+    'A/B/E/alpha'      : Item(status='A '),
+    'A/B/F'            : Item(status='A '),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_disk = svntest.main.greek_state.copy()
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None,
+                                        None, None, None, None,
+                                        '--set-depth', 'infinity', B_path)
+  verify_depth(None, "infinity", B_path)
+  expected_info = {
+      'Path' : re.escape(B_path),
+      'Repository Root' : sbox.repo_url,
+      'Repository UUID' : svntest.actions.get_wc_uuid(wc_dir),
+  #   'Depth' value is absent for 'infinity'
+  }
+  svntest.actions.run_and_verify_info([expected_info], B_path)
 
 #----------------------------------------------------------------------
 # list all tests here, starting with None:
@@ -2546,6 +2701,7 @@
               tree_conflicts_resolved_depth_files,
               tree_conflicts_resolved_depth_immediates,
               tree_conflicts_resolved_depth_infinity,
+              update_excluded_path_sticky_depths,
             ]
 
 if __name__ == "__main__":



Mime
View raw message