You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2011/08/01 15:25:05 UTC

svn commit: r1152763 - in /subversion/branches/1.7.x-r1152189: ./ subversion/libsvn_wc/copy.c subversion/tests/cmdline/copy_tests.py

Author: philip
Date: Mon Aug  1 13:25:04 2011
New Revision: 1152763

URL: http://svn.apache.org/viewvc?rev=1152763&view=rev
Log:
Merge r1152189-1152190 to 1.7.x-r1152189 and resolve conflicts.

 * r1152189, r1152190
   Fix an assertion on copying nodes that are not presence normal.

Modified:
    subversion/branches/1.7.x-r1152189/   (props changed)
    subversion/branches/1.7.x-r1152189/subversion/libsvn_wc/copy.c
    subversion/branches/1.7.x-r1152189/subversion/tests/cmdline/copy_tests.py

Propchange: subversion/branches/1.7.x-r1152189/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug  1 13:25:04 2011
@@ -54,4 +54,4 @@
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
 /subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1147882,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149572,1149675,1149701,1149713,1150242,1150372,1150441,1150506,1150812,1150853,1151036,1151911,1152129
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1147882,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149572,1149675,1149701,1149713,1150242,1150372,1150441,1150506,1150812,1150853,1151036,1151911,1152129,1152189-1152190

Modified: subversion/branches/1.7.x-r1152189/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1152189/subversion/libsvn_wc/copy.c?rev=1152763&r1=1152762&r2=1152763&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1152189/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/1.7.x-r1152189/subversion/libsvn_wc/copy.c Mon Aug  1 13:25:04 2011
@@ -615,6 +615,23 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
     else
       SVN_ERR(err);
 
+    switch (src_status)
+      {
+        case svn_wc__db_status_deleted:
+          return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                   _("Deleted node '%s' can't be copied."),
+                                   svn_dirent_local_style(src_abspath,
+                                                          scratch_pool));
+
+        case svn_wc__db_status_excluded:
+        case svn_wc__db_status_server_excluded:
+        case svn_wc__db_status_not_present:
+          return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                   _("The node '%s' was not found."),
+                                   svn_dirent_local_style(src_abspath,
+                                                          scratch_pool));
+      }
+
     SVN_ERR(svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
                                  &dst_repos_root_url, &dst_repos_uuid, NULL,
                                  NULL, NULL, NULL, NULL, NULL, NULL, NULL,

Modified: subversion/branches/1.7.x-r1152189/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1152189/subversion/tests/cmdline/copy_tests.py?rev=1152763&r1=1152762&r2=1152763&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1152189/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/1.7.x-r1152189/subversion/tests/cmdline/copy_tests.py Mon Aug  1 13:25:04 2011
@@ -5441,6 +5441,35 @@ def copy_and_move_conflicts(sbox):
     })
   svntest.actions.verify_disk(wc('move-dest'), expected_disk, True)
 
+def copy_deleted_dir(sbox):
+  "try to copy a deleted directory that exists"
+  sbox.build(read_only = True)
+
+  sbox.simple_rm('iota')
+  sbox.simple_rm('A')
+
+  svntest.actions.run_and_verify_svn(None, None,
+                                     'svn: E145000: Path.* does not exist',
+                                     'cp', sbox.ospath('iota'),
+                                     sbox.ospath('new_iota'))
+  svntest.actions.run_and_verify_svn(None, None,
+                                     'svn: E145000: Path.* does not exist',
+                                     'cp', sbox.ospath('A/D'),
+                                     sbox.ospath('new_D'))
+
+  svntest.main.file_write(sbox.ospath('iota'), 'Not iota!')
+  os.mkdir(sbox.ospath('A'))
+  os.mkdir(sbox.ospath('A/D'))
+
+  # These two invocations raise an assertion.
+  svntest.actions.run_and_verify_svn(None, None,
+                                     'svn: E155035: Deleted node.* can\'t be.*',
+                                     'cp', sbox.ospath('iota'),
+                                     sbox.ospath('new_iota'))
+  svntest.actions.run_and_verify_svn(None, None,
+                                     'svn: E155035: Deleted node.* can\'t be.*',
+                                     'cp', sbox.ospath('A/D'),
+                                     sbox.ospath('new_D'))
 
 ########################################################################
 # Run the tests
@@ -5551,6 +5580,7 @@ test_list = [ None,
               copy_base_of_deleted,
               case_only_rename,
               copy_and_move_conflicts,
+              copy_deleted_dir,
              ]
 
 if __name__ == '__main__':