You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/07/27 09:48:40 UTC
svn commit: r1507594 - in /subversion/branches/1.8.x-issue4400: ./
subversion/libsvn_ra_serf/commit.c subversion/tests/cmdline/commit_tests.py
Author: breser
Date: Sat Jul 27 07:48:40 2013
New Revision: 1507594
URL: http://svn.apache.org/r1507594
Log:
On the 1.8.x-issue4400 branch, merge r1507567 and r1507589 from trunk.
Only a minor conflict in commit_tests.py due to a test on trunk that isn't on
1.8.x
Modified:
subversion/branches/1.8.x-issue4400/ (props changed)
subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c
subversion/branches/1.8.x-issue4400/subversion/tests/cmdline/commit_tests.py
Propchange: subversion/branches/1.8.x-issue4400/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1507567,1507589
Modified: subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c?rev=1507594&r1=1507593&r2=1507594&view=diff
==============================================================================
--- subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c Sat Jul 27 07:48:40 2013
@@ -397,10 +397,21 @@ checkout_dir(dir_context_t *dir,
{
if (p_dir->added)
{
+ /* Calculate how much of the relpath to skip to compose the
+ * working_url. If the relpath is an empty string then the parent
+ * is the root of the commit and we need to just add the entire
+ * relpath to the parent's working_url. Otherwise we need to skip
+ * the strlen(parent->relpath) + 1 to account for the slash.
+ * It is safe to assume that every added directory has a parent. */
+ dir_context_t *parent = p_dir->parent_dir;
+ size_t skip = strlen(parent->relpath);
+ if (skip)
+ skip++;
+
/* Implicitly checkout this dir now. */
dir->working_url = svn_path_url_add_component2(
- dir->parent_dir->working_url,
- dir->name, dir->pool);
+ parent->working_url,
+ dir->relpath + skip, dir->pool);
return SVN_NO_ERROR;
}
p_dir = p_dir->parent_dir;
Modified: subversion/branches/1.8.x-issue4400/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-issue4400/subversion/tests/cmdline/commit_tests.py?rev=1507594&r1=1507593&r2=1507594&view=diff
==============================================================================
--- subversion/branches/1.8.x-issue4400/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/1.8.x-issue4400/subversion/tests/cmdline/commit_tests.py Sat Jul 27 07:48:40 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__':