Author: svn-role
Date: Sat Aug 10 04:00:35 2013
New Revision: 1512558
URL: http://svn.apache.org/r1512558
Log:
Merge the 1.8.x-issue4400 branch:
* r1507567, r1507589, r1512195
Fix issue #4400: crash when committing cp with deep deletion.
Branch:
^/subversion/branches/1.8.x-issue4400
Justification:
SEGV and Regression from 1.7.
Votes:
+1: breser, danielsh, ivan
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/subversion/libsvn_ra_serf/commit.c
subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1507567,1507589,1512195
Merged /subversion/branches/1.8.x-issue4400:r1507591-1512557
Modified: subversion/branches/1.8.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1512558&r1=1512557&r2=1512558&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Sat Aug 10 04:00:35 2013
@@ -253,12 +253,3 @@ Veto-blocked changes:
Approved changes:
=================
-
- * r1507567, r1507589, r1512195
- Fix issue #4400: crash when committing cp with deep deletion.
- Branch:
- ^/subversion/branches/1.8.x-issue4400
- Justification:
- SEGV and Regression from 1.7.
- Votes:
- +1: breser, danielsh, ivan
Modified: subversion/branches/1.8.x/subversion/libsvn_ra_serf/commit.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_serf/commit.c?rev=1512558&r1=1512557&r2=1512558&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_serf/commit.c Sat Aug 10
04:00:35 2013
@@ -397,10 +397,18 @@ checkout_dir(dir_context_t *dir,
{
if (p_dir->added)
{
+ /* Calculate the working_url by skipping the shared ancestor bewteen
+ * the parent->relpath and dir->relpath. This is safe since an
+ * add is guaranteed to have a parent that is checked out. */
+ dir_context_t *parent = p_dir->parent_dir;
+ const char *relpath = svn_relpath_skip_ancestor(parent->relpath,
+ dir->relpath);
+
/* Implicitly checkout this dir now. */
+ SVN_ERR_ASSERT(parent->working_url);
dir->working_url = svn_path_url_add_component2(
- dir->parent_dir->working_url,
- dir->name, dir->pool);
+ parent->working_url,
+ relpath, dir->pool);
return SVN_NO_ERROR;
}
p_dir = p_dir->parent_dir;
Modified: subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py?rev=1512558&r1=1512557&r2=1512558&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py
(original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/commit_tests.py Sat Aug
10 04:00:35 2013
@@ -2946,6 +2946,60 @@ def last_changed_of_copied_subdir(sbox):
svntest.actions.run_and_verify_info([expected], E_copied)
+@Issue(4400)
+def commit_cp_with_deep_delete(sbox):
+ "verify behavior of a copy with a deep (>=3) delete"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Prep by adding a tree deep enough to exercise the issue.
+ sbox.simple_mkdir('A/B/E/I')
+ sbox.simple_commit(message='prep')
+ svntest.main.run_svn(None, 'up', wc_dir)
+
+ # copy the deep tree and then delete a dir 3 deep.
+ sbox.simple_copy('A','A2')
+ sbox.simple_rm('A2/B/E/I')
+
+ # come up with the expected output and status
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A2' : Item(verb='Adding'),
+ 'A2/B/E/I' : Item(verb='Deleting'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'A/B/E/I' : Item(status=' ', wc_rev='2'),
+ 'A2' : Item(status=' ', wc_rev='3'),
+ 'A2/B' : Item(status=' ', wc_rev='3'),
+ 'A2/B/lambda' : Item(status=' ', wc_rev='3'),
+ 'A2/B/F' : Item(status=' ', wc_rev='3'),
+ 'A2/B/E' : Item(status=' ', wc_rev='3'),
+ 'A2/B/E/alpha' : Item(status=' ', wc_rev='3'),
+ 'A2/B/E/beta' : Item(status=' ', wc_rev='3'),
+ 'A2/D' : Item(status=' ', wc_rev='3'),
+ 'A2/D/gamma' : Item(status=' ', wc_rev='3'),
+ 'A2/D/H' : Item(status=' ', wc_rev='3'),
+ 'A2/D/H/psi' : Item(status=' ', wc_rev='3'),
+ 'A2/D/H/omega' : Item(status=' ', wc_rev='3'),
+ 'A2/D/H/chi' : Item(status=' ', wc_rev='3'),
+ 'A2/D/G' : Item(status=' ', wc_rev='3'),
+ 'A2/D/G/tau' : Item(status=' ', wc_rev='3'),
+ 'A2/D/G/rho' : Item(status=' ', wc_rev='3'),
+ 'A2/D/G/pi' : Item(status=' ', wc_rev='3'),
+ 'A2/C' : Item(status=' ', wc_rev='3'),
+ 'A2/mu' : Item(status=' ', wc_rev='3'),
+ })
+
+ # Commit the copy without the one dir.
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ wc_dir)
+
+
+
########################################################################
# Run the tests
@@ -3017,6 +3071,7 @@ test_list = [ None,
commit_add_subadd,
commit_danglers,
last_changed_of_copied_subdir,
+ commit_cp_with_deep_delete,
]
if __name__ == '__main__':