[[[
Fix for issue 1825. failed switch or update may corrupt working copy
Patch from <makl@tigris.org>
* subversion/libsvn_wc/adm_crawler.c
(report_revisions): Always report deleted entries as deleted.
* subversion/tests/clients/cmdline/switch_tests.py
(regression_test_1825): New regression test.
]]]
Index: subversion/libsvn_wc/adm_crawler.c
===================================================================
--- subversion/libsvn_wc/adm_crawler.c (revision 9407)
+++ subversion/libsvn_wc/adm_crawler.c (working copy)
@@ -237,11 +237,12 @@
/*** The Big Tests: ***/
- /* If the entry is 'deleted' or 'absent', make sure the server
+ /* If the entry is 'deleted' make sure the server knows it's gone...
+ If the entry is 'absent', make sure the server
knows it's gone... unless we're reporting everything, in
which case it's already missing on the server. */
- if ((current_entry->deleted || current_entry->absent)
- && (! report_everything))
+ if (current_entry->deleted
+ || (! report_everything && current_entry->absent))
{
SVN_ERR (reporter->delete_path (report_baton, this_path, iterpool));
continue;
Index: subversion/tests/clients/cmdline/switch_tests.py
===================================================================
--- subversion/tests/clients/cmdline/switch_tests.py (revision 9407)
+++ subversion/tests/clients/cmdline/switch_tests.py (working copy)
@@ -802,6 +802,40 @@
svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+#----------------------------------------------------------------------
+# Regression test for issue #1825: failed switch or update may corrupt
+# working copy
+
+def regression_test_1825(sbox):
+ "regression test for issue #1825"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ E_url = svntest.main.current_repo_url + '/A/B/E'
+ E_url2 = svntest.main.current_repo_url + '/A/B/Esave'
+ wc_dir = sbox.wc_dir
+ wc_E_dir = wc_dir + '/A/B/E'
+ wc_alpha_file = wc_dir + '/A/B/E/alpha'
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp', '-m', '',
+ E_url, E_url2)
+ svntest.actions.run_and_verify_svn(None, None, [], 'rm', wc_alpha_file)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', '', wc_E_dir)
+
+ svntest.main.file_append(wc_alpha_file, "hello")
+ out, err = svntest.main.run_svn(1, 'sw', E_url2, wc_E_dir)
+ for line in err:
+ if line.find("object of the same name already exists") != -1:
+ break
+ else:
+ raise svntest.Failure
+
+ os.remove(wc_alpha_file)
+ svntest.actions.run_and_verify_svn(None, None, [], 'sw', E_url + 'save',
+ wc_E_dir)
+
+
########################################################################
# Run the tests
@@ -820,6 +854,7 @@
XFail(file_dir_file),
nonrecursive_switching,
failed_anchor_is_target,
+ regression_test_1825,
]
if __name__ == '__main__':
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 17 09:37:42 2004