Author: rhuijben
Date: Thu May 5 19:43:07 2011
New Revision: 1099940
URL: http://svn.apache.org/viewvc?rev=1099940&view=rev
Log:
Following up on r1099914, also handle the error in the higher level copying
code and revert the change to assume that everything with the path of a
versioned item is the versioned item. Only status normal and status added
nodes exist. With any other status the in-working copy file is unrelated.
* subversion/libsvn_wc/copy.c
(copy_versioned_dir): Handle absent status. Make sure we don't handle
unrelated resources that just have a magic path names as somehow
versioned. (Especially on case insensitive filesystems this could have
very serious side effects)
* subversion/tests/cmdline/authz_tests.py
(wc_wc_copy_revert): Expect a working copy error code; not a repository
authorization one.
Modified:
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/tests/cmdline/authz_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1099940&r1=1099939&r2=1099940&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu May 5 19:43:07 2011
@@ -422,19 +422,11 @@ copy_versioned_dir(svn_wc__db_t *db,
db, child_src_abspath,
iterpool, iterpool));
- if (child_status == svn_wc__db_status_deleted
- || child_status == svn_wc__db_status_not_present
- || child_status == svn_wc__db_status_excluded)
- {
- SVN_ERR(copy_deleted_node(db,
- child_src_abspath, child_dst_abspath,
- dst_op_root_abspath,
- cancel_func, cancel_baton, NULL, NULL,
- iterpool));
- }
- else
+ if (child_status == svn_wc__db_status_normal
+ || child_status == svn_wc__db_status_added)
{
- if (child_kind == svn_wc__db_kind_file)
+ /* We have more work to do than just changing the DB */
+ if (child_kind == svn_wc__db_kind_file)
SVN_ERR(copy_versioned_file(db,
child_src_abspath, child_dst_abspath,
dst_op_root_abspath,
@@ -454,6 +446,27 @@ copy_versioned_dir(svn_wc__db_t *db,
svn_dirent_local_style(child_src_abspath,
scratch_pool));
}
+ else if (child_status == svn_wc__db_status_deleted
+ || child_status == svn_wc__db_status_not_present
+ || child_status == svn_wc__db_status_excluded)
+ {
+ /* This will be copied as some kind of deletion. Don't touch
+ any actual files */
+ SVN_ERR(copy_deleted_node(db,
+ child_src_abspath, child_dst_abspath,
+ dst_op_root_abspath,
+ cancel_func, cancel_baton, NULL, NULL,
+ iterpool));
+ }
+ else
+ {
+ SVN_ERR_ASSERT(child_status == svn_wc__db_status_absent);
+
+ return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+ _("Cannot copy '%s' excluded by server"),
+ svn_dirent_local_style(src_abspath,
+ iterpool));
+ }
if (disk_children
&& (child_status == svn_wc__db_status_normal
Modified: subversion/trunk/subversion/tests/cmdline/authz_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/authz_tests.py?rev=1099940&r1=1099939&r2=1099940&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/authz_tests.py Thu May 5
19:43:07 2011
@@ -1027,8 +1027,8 @@ def wc_wc_copy_revert(sbox):
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
svntest.actions.run_and_verify_svn(None, None,
- 'svn: E220001: Cannot copy.*excluded by
server',
- 'cp', sbox.ospath('A'), sbox.ospath('A2'))
+ 'svn: E155035: Cannot copy.*excluded by server',
+ 'cp', sbox.ospath('A'), sbox.ospath('A2'))
# The copy failed and A2/B/E is incomplete. That means A2 and A2/B