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/05/20 17:59:36 UTC
svn commit: r1125443 - in /subversion/trunk/subversion: libsvn_client/copy.c
tests/cmdline/copy_tests.py
Author: philip
Date: Fri May 20 15:59:36 2011
New Revision: 1125443
URL: http://svn.apache.org/viewvc?rev=1125443&view=rev
Log:
Allow wc-to-wc copyies of the base of a deleted node, rather than
crashing, as this was supported by 1.6.
* subversion/libsvn_client/copy.c
(try_copy): Avoid using an unitialised variable, scan deletions.
* subversion/tests/cmdline/copy_tests.py
(mixed_rev_copy_del): Remove outdated comment.
(copy_base_of_deleted): New test.
(test_list): Add new test.
Modified:
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1125443&r1=1125442&r2=1125443&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Fri May 20 15:59:36 2011
@@ -2224,14 +2224,13 @@ try_copy(const apr_array_header_t *sourc
NULL,
ctx->wc_ctx,
pair->src_abspath_or_url,
- FALSE, iterpool, iterpool));
+ TRUE, iterpool, iterpool));
if (copyfrom_repos_relpath)
url = svn_path_url_add_component2(copyfrom_repos_root_url,
copyfrom_repos_relpath,
pool);
-
- if (url == NULL)
+ else
return svn_error_createf
(SVN_ERR_ENTRY_MISSING_URL, NULL,
_("'%s' does not have a URL associated with it"),
Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1125443&r1=1125442&r2=1125443&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Fri May 20 15:59:36 2011
@@ -4753,15 +4753,6 @@ def mixed_rev_copy_del(sbox):
entry_status=None)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
- # This test currently fails above, as both alpha and beta disappear
- # from status, what should happen is unclear. In 1.6 both names
- # remained in status 'D'.
-
- # The commit doesn't work either, it should not delete alpha but
- # must delete beta. In 1.6 both alpha and beta were deleted and the
- # commit failed. It's not clear how the client can determine that
- # alpha and beta should be treated differently.
- # See issue 3314
expected_output = svntest.wc.State(wc_dir, {
'A/B/E_copy' : Item(verb='Adding'),
'A/B/E_copy/beta' : Item(verb='Deleting'),
@@ -4773,6 +4764,7 @@ def mixed_rev_copy_del(sbox):
expected_status,
None,
wc_dir)
+
def copy_delete_undo(sbox, use_revert):
"copy, delete child, undo"
@@ -5163,6 +5155,23 @@ def deleted_file_with_case_clash(sbox):
}
svntest.actions.run_and_verify_info([expected_info_IOTA], IOTA_path)
+def copy_base_of_deleted(sbox):
+ """copy -rBASE deleted"""
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'rm', sbox.ospath('A/mu'))
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='D ')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp', '-rBASE',
+ sbox.ospath('A/mu'), sbox.ospath('A/mu2'))
+ expected_status.add({
+ 'A/mu2' : Item(status='A ', copied='+', wc_rev='-'),
+ })
+
########################################################################
# Run the tests
@@ -5270,6 +5279,7 @@ test_list = [ None,
copy_wc_url_with_absent,
copy_url_shortcut,
deleted_file_with_case_clash,
+ copy_base_of_deleted,
]
if __name__ == '__main__':