Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF50310A73 for ; Sat, 27 Jul 2013 07:49:06 +0000 (UTC) Received: (qmail 52279 invoked by uid 500); 27 Jul 2013 07:49:06 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 52257 invoked by uid 500); 27 Jul 2013 07:49:06 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 52239 invoked by uid 99); 27 Jul 2013 07:49:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jul 2013 07:49:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jul 2013 07:49:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2C7962388993; Sat, 27 Jul 2013 07:48:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1507594 - in /subversion/branches/1.8.x-issue4400: ./ subversion/libsvn_ra_serf/commit.c subversion/tests/cmdline/commit_tests.py Date: Sat, 27 Jul 2013 07:48:40 -0000 To: commits@subversion.apache.org From: breser@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130727074841.2C7962388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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__':