Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/externals_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/externals_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/externals_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/externals_tests.py Wed Feb 25 08:15:39 2015 @@ -3343,7 +3343,6 @@ def file_external_versioned_obstruction( expected_status) @Issue(4495) -@XFail() def update_external_peg_rev(sbox): "update external peg rev" @@ -3437,7 +3436,7 @@ def update_deletes_file_external(sbox): # As of r1448345, this update fails: # E000002: Can't remove directory '.../A_copy/C': No such file or directory sbox.simple_update() - + @Issue(4519) def switch_relative_externals(sbox): @@ -3541,6 +3540,540 @@ def replace_tree_with_foreign_external(s None, None, None, None, None, 1, '-r', '2', wc_dir) + +def verify_pinned_externals(sbox, external_url_for, base_path_or_url, + external_youngest_rev, other_external_youngest_rev): + "helper for pin-externals tests" + + expected_output = [ + '%s@%d gamma\n' % (external_url_for["A/B/gamma"], + external_youngest_rev), + '\n', + ] + if svntest.sandbox.is_url(base_path_or_url): + target = base_path_or_url + '/A_copy/B' + else: + target = sbox.ospath('A_copy/B') + svntest.actions.run_and_verify_svn(expected_output, [], + 'propget', 'svn:externals', + target) + expected_output = [ + 'exdir_G -r%d %s\n' % (other_external_youngest_rev, + external_url_for["A/C/exdir_G"]), + '%s exdir_H\n' % external_url_for["A/C/exdir_H"], + '\n', + ] + if svntest.sandbox.is_url(base_path_or_url): + target = base_path_or_url + '/A_copy/C' + else: + target = sbox.ospath('A_copy/C') + svntest.actions.run_and_verify_svn(expected_output, [], + 'propget', 'svn:externals', + target) + expected_output = [ + '%s@%d exdir_A\n' % (external_url_for["A/D/exdir_A"], + other_external_youngest_rev), + '%s@%d exdir_A/G\n' % (external_url_for["A/D/exdir_A/G/"], + other_external_youngest_rev), + 'exdir_A/H -r1 %s\n' % external_url_for["A/D/exdir_A/H"], + '%s@%d x/y/z/blah\n' % (external_url_for["A/D/x/y/z/blah"], + other_external_youngest_rev), + '\n', + ] + if svntest.sandbox.is_url(base_path_or_url): + target = base_path_or_url + '/A_copy/D' + else: + target = sbox.ospath('A_copy/D') + svntest.actions.run_and_verify_svn(expected_output, [], + 'propget', 'svn:externals', + target) + + +def copy_pin_externals_repos_repos(sbox): + "svn copy --pin-externals repos->repos" + + external_url_for = externals_test_setup(sbox) + + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_dir = repo_dir + ".other" + + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + + # Perform a repos->repos copy, pinning externals + svntest.actions.run_and_verify_svn(None, [], + 'copy', + repo_url + '/A', + repo_url + '/A_copy', + '-m', 'copy', + '--pin-externals') + verify_pinned_externals(sbox, external_url_for, repo_url, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_repos_wc(sbox): + "svn copy --pin-externals repos->wc" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_dir = repo_dir + ".other" + + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + # Perform a repos->wc copy, pinning externals + external_youngest_rev = svntest.main.youngest(repo_dir) + svntest.actions.run_and_verify_svn(None, [], + 'copy', + repo_url + '/A', + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + verify_pinned_externals(sbox, external_url_for, wc_dir, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_wc_repos(sbox): + "svn copy --pin-externals wc->repos" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_dir = repo_dir + ".other" + + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + # Perform a wc->repos copy, pinning externals + svntest.actions.run_and_verify_svn(None, [], + 'copy', + os.path.join(wc_dir, 'A'), + repo_url + '/A_copy', + '-m', 'copy', + '--pin-externals') + verify_pinned_externals(sbox, external_url_for, repo_url, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_wc_wc(sbox): + "svn copy --pin-externals wc->wc" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_dir = repo_dir + ".other" + + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + # Perform a wc->wc copy, pinning externals + svntest.actions.run_and_verify_svn(None, [], + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + verify_pinned_externals(sbox, external_url_for, wc_dir, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_moved_external(sbox): + "pin externals which were moved since last changed" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_dir = repo_dir + ".other" + + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + # Test behaviour for external URLs which were moved since + # their last-changed revision. + sbox.simple_move('A/D/gamma', 'A/D/gamma-moved') + sbox.simple_commit() + change_external(sbox.ospath('A/B'), '^/A/D/gamma-moved gamma', commit=True) + sbox.simple_update() + external_youngest_rev = svntest.main.youngest(repo_dir) + svntest.actions.run_and_verify_svn(None, [], + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + external_url_for["A/B/gamma"] = '^/A/D/gamma-moved' + verify_pinned_externals(sbox, external_url_for, wc_dir, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_removed_in_head(sbox): + "already pinned external which was removed in HEAD" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_url = repo_url + ".other" + other_repo_dir = repo_dir + ".other" + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + # Test an already pinned external which was removed in HEAD. + svntest.actions.run_and_verify_svn(None, [], + 'rm', + other_repo_url + '/A/D/H', + '-m', 'remove A/D/H') + sbox.simple_update() + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + svntest.actions.run_and_verify_svn(None, [], + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + verify_pinned_externals(sbox, external_url_for, wc_dir, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_from_old_rev(sbox): + "copy from an old revision with pinning" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + repo_dir = sbox.repo_dir + other_repo_url = repo_url + ".other" + other_repo_dir = repo_dir + ".other" + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + # Create a couple of revisions affecting 'A'. + for i in range(5): + svntest.main.file_append(sbox.ospath('A/mu'), 'a new line') + sbox.simple_commit() + sbox.simple_update() + + # Test a copy from an old revision with pinning. + external_youngest_rev = svntest.main.youngest(repo_dir) + other_external_youngest_rev = svntest.main.youngest(other_repo_dir) + svntest.actions.run_and_verify_svn(None, [], + 'copy', + os.path.join(wc_dir, 'A@6'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + external_url_for["A/B/gamma"] = '^/A/D/gamma' + verify_pinned_externals(sbox, external_url_for, wc_dir, + external_youngest_rev, other_external_youngest_rev) + + +def copy_pin_externals_wc_local_mods(sbox): + "cannot pin WC externals with local mods" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + svntest.main.file_append(sbox.ospath('A/C/exdir_G/pi'), 'this file changed') + expected_stderr = verify.RegexOutput(".*Cannot pin.*local modifications.*", + match_all=False) + svntest.actions.run_and_verify_svn(None, expected_stderr, + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + + +def copy_pin_externals_wc_switched_subtrees(sbox): + "cannot pin WC externals with switched subtrees" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + svntest.actions.run_and_verify_svn(None, [], + 'switch', '--ignore-ancestry', '^/A/B', + sbox.ospath('A/D/exdir_A/C')) + expected_stderr = verify.RegexOutput(".*Cannot pin.*switched subtree.*", + match_all=False) + svntest.actions.run_and_verify_svn(None, expected_stderr, + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + + +def copy_pin_externals_wc_mixed_revisions(sbox): + "cannot pin WC externals with mixed revisions" + + external_url_for = externals_test_setup(sbox) + + wc_dir = sbox.wc_dir + repo_url = sbox.repo_url + + # Create a working copy. + svntest.actions.run_and_verify_svn(None, [], + 'checkout', + repo_url, wc_dir) + + svntest.actions.run_and_verify_svn(None, [], + 'update', '-r1', + sbox.ospath('A/D/exdir_A/mu')) + expected_stderr = verify.RegexOutput(".*Cannot pin.*mixed-revision.*", + match_all=False) + svntest.actions.run_and_verify_svn(None, expected_stderr, + 'copy', + os.path.join(wc_dir, 'A'), + os.path.join(wc_dir, 'A_copy'), + '--pin-externals') + +@Issue(4558) +def copy_pin_externals_whitepace_dir(sbox): + "copy --pin-externals with whitepace dir" + + sbox.build(empty=True) + repo_url = sbox.repo_url + wc_dir = sbox.wc_dir + ss_path = repo_url[repo_url.find('//'):] + + extdef = sbox.get_tempname('extdef') + info = sbox.get_tempname('info') + + open(extdef, 'w').write( + '"' + ss_path +'/deps/sqlite" ext/sqlite\n' + + '"^/deps/A P R" \'ext/A P R\'\n' + + '^/deps/B\ D\ B\' ext/B\ D\ B\'\n' + + repo_url + '/deps/wors%23+t ext/wors#+t') + open(info, 'w').write('info\n') + + svntest.actions.run_and_verify_svnmucc(None, [], '-U', repo_url, + 'mkdir', 'trunk', + 'mkdir', 'branches', + 'mkdir', 'deps', + 'mkdir', 'deps/sqlite', + 'put', info, 'deps/sqlite/readme', + 'mkdir', 'deps/A P R', + 'put', info, 'deps/A P R/about', + 'mkdir', 'deps/B D B\'', + 'put', info, 'deps/B D B\'/copying', + 'mkdir', 'deps/wors#+t', + 'put', info, 'deps/wors#+t/brood', + 'propsetf', 'svn:externals', extdef, + 'trunk', + '-mm' + ) + + svntest.actions.run_and_verify_svn(None, [], 'update', sbox.ospath('trunk'), + '--ignore-externals') + sbox.simple_update('branches') + + expected_status = svntest.wc.State(wc_dir, { + '' : Item(status=' ', wc_rev='0'), + 'trunk' : Item(status=' ', wc_rev='1'), + 'branches' : Item(status=' ', wc_rev='1'), + }) + + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + trunk_url = repo_url + '/trunk' + branches_url = repo_url + '/branches' + trunk_wc = sbox.ospath('trunk') + + # Create a new revision to creat interesting pinning revisions + sbox.simple_propset('A', 'B', 'trunk') + sbox.simple_commit('trunk') + + # And let's copy/pin + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--pin-externals', + trunk_url, branches_url + '/url-url', '-mm') + + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--pin-externals', + trunk_url, sbox.ospath('branches/url-wc')) + sbox.simple_commit('branches/url-wc') + + # Now try to copy without externals in the WC + expected_err = '.*E155035: Cannot pin external.*' + svntest.actions.run_and_verify_svn(None, expected_err, + 'copy', '--pin-externals', + trunk_wc, branches_url + '/wc-url', '-mm') + + svntest.actions.run_and_verify_svn(None, expected_err, + 'copy', '--pin-externals', + trunk_wc, sbox.ospath('branches/wc-wc')) + + # Bring in the externals on trunk + svntest.actions.run_and_verify_svn(None, [], 'update', sbox.ospath('trunk')) + expected_status = svntest.wc.State(wc_dir, { + 'trunk' : Item(status=' ', wc_rev='4'), + 'trunk/ext' : Item(status='X '), + 'trunk/ext/sqlite' : Item(status=' ', wc_rev='4'), + 'trunk/ext/sqlite/readme' : Item(status=' ', wc_rev='4'), + 'trunk/ext/A P R' : Item(status=' ', wc_rev='4'), + 'trunk/ext/A P R/about' : Item(status=' ', wc_rev='4'), + 'trunk/ext/B D B\'' : Item(status=' ', wc_rev='4'), + 'trunk/ext/B D B\'/copying' : Item(status=' ', wc_rev='4'), + 'trunk/ext/wors#+t' : Item(status=' ', wc_rev='4'), + 'trunk/ext/wors#+t/brood' : Item(status=' ', wc_rev='4'), + }) + svntest.actions.run_and_verify_status(sbox.ospath('trunk'), expected_status) + + # And copy again + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--pin-externals', + trunk_wc, branches_url + '/wc-url', '-mm') + + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--pin-externals', + trunk_wc, sbox.ospath('branches/wc-wc')) + sbox.simple_commit('branches/wc-wc') + + + expected_output = svntest.wc.State(wc_dir, { + 'branches/url-url' : Item(status='A '), + 'branches/url-url/ext/A P R/about' : Item(status='A '), + 'branches/url-url/ext/B D B\'/copying' : Item(status='A '), + 'branches/url-url/ext/wors#+t/brood' : Item(status='A '), + 'branches/url-url/ext/sqlite/readme' : Item(status='A '), + + # url-wc is already up to date + + 'branches/wc-url' : Item(status='A '), + 'branches/wc-url/ext/wors#+t/brood' : Item(status='A '), + 'branches/wc-url/ext/sqlite/readme' : Item(status='A '), + 'branches/wc-url/ext/B D B\'/copying' : Item(status='A '), + 'branches/wc-url/ext/A P R/about' : Item(status='A '), + + ## branches/wc-wc should checkout its externals here + }) + expected_status = svntest.wc.State(wc_dir, { + 'branches' : Item(status=' ', wc_rev='6'), + + 'branches/url-url' : Item(status=' ', wc_rev='6'), + 'branches/url-url/ext' : Item(status='X '), + 'branches/url-url/ext/A P R' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/A P R/about' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/sqlite' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/sqlite/readme' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/wors#+t' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/wors#+t/brood' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/B D B\'' : Item(status=' ', wc_rev='2'), + 'branches/url-url/ext/B D B\'/copying' : Item(status=' ', wc_rev='2'), + + 'branches/url-wc' : Item(status=' ', wc_rev='6'), + 'branches/url-wc/ext' : Item(status='X '), + 'branches/url-wc/ext/wors#+t' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/wors#+t/brood' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/B D B\'' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/B D B\'/copying' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/sqlite' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/sqlite/readme' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/A P R' : Item(status=' ', wc_rev='3'), + 'branches/url-wc/ext/A P R/about' : Item(status=' ', wc_rev='3'), + + 'branches/wc-url' : Item(status=' ', wc_rev='6'), + 'branches/wc-url/ext' : Item(status='X '), + 'branches/wc-url/ext/wors#+t' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/wors#+t/brood' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/sqlite' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/sqlite/readme' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/B D B\'' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/B D B\'/copying' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/A P R' : Item(status=' ', wc_rev='4'), + 'branches/wc-url/ext/A P R/about' : Item(status=' ', wc_rev='4'), + + 'branches/wc-wc' : Item(status=' ', wc_rev='6'), + 'branches/wc-wc/ext' : Item(status='X '), + 'branches/wc-wc/ext/wors#+t' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/wors#+t/brood' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/sqlite' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/sqlite/readme' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/B D B\'' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/B D B\'/copying' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/A P R' : Item(status=' ', wc_rev='4'), + 'branches/wc-wc/ext/A P R/about' : Item(status=' ', wc_rev='4'), + }) + svntest.actions.run_and_verify_update(wc_dir + '/branches', expected_output, + None, expected_status, []) + + # Now let's use our existing setup to perform some copies with dynamic + # destinations + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--parents', '--pin-externals', + repo_url + '/branches/wc-url', + repo_url + '/branches/url-url', + trunk_url, + branches_url + '/3x-url-url', + '-mm') + + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--parents', '--pin-externals', + repo_url + '/branches/wc-url', + repo_url + '/branches/url-url', + trunk_url, + sbox.ospath('branches/3x-url-wc')) + + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--parents', '--pin-externals', + sbox.ospath('branches/wc-url'), + sbox.ospath('branches/url-url'), + sbox.ospath('trunk'), + branches_url + '/3x-wc-url', + '-mm') + + svntest.actions.run_and_verify_svn(None, [], + 'copy', '--parents', '--pin-externals', + sbox.ospath('branches/wc-url'), + sbox.ospath('branches/url-url'), + sbox.ospath('trunk'), + sbox.ospath('branches/3x-wc-wc')) + def nested_notification(sbox): "notification for nested externals" @@ -3638,6 +4171,17 @@ test_list = [ None, switch_relative_externals, copy_file_external_to_repo, replace_tree_with_foreign_external, + copy_pin_externals_repos_repos, + copy_pin_externals_repos_wc, + copy_pin_externals_wc_repos, + copy_pin_externals_wc_wc, + copy_pin_externals_moved_external, + copy_pin_externals_removed_in_head, + copy_pin_externals_from_old_rev, + copy_pin_externals_wc_local_mods, + copy_pin_externals_wc_switched_subtrees, + copy_pin_externals_wc_mixed_revisions, + copy_pin_externals_whitepace_dir, nested_notification, ]
Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Wed Feb 25 08:15:39 2015 @@ -46,7 +46,6 @@ Available subcommands: unlock update (up) upgrade - youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Wed Feb 25 08:15:39 2015 @@ -46,7 +46,6 @@ Available subcommands: unlock update (up) upgrade - youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/info_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/info_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/info_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/info_tests.py Wed Feb 25 08:15:39 2015 @@ -591,6 +591,51 @@ def relpath_escaping(sbox): svntest.actions.run_and_verify_update(wc_dir, expected_output, None, None) +def node_hidden_info(sbox): + "fetch svn info on 'hidden' nodes" + + sbox.build() + + sbox.simple_rm('A/B/E/alpha') + sbox.simple_commit() + svntest.actions.run_and_verify_svn(None, [], + 'up', '--set-depth', 'exclude', + sbox.ospath('A/B/E/beta')) + + sbox.simple_copy('A/B/E', 'E') + + # Running info on BASE not-present fails + expected_err = '.*(E|W)155010: The node \'.*alpha\' was not found.*' + svntest.actions.run_and_verify_svn(None, expected_err, + 'info', sbox.ospath('A/B/E/alpha')) + + expected_info = [ + { + 'Path': re.escape(sbox.ospath('A/B/E/beta')), + 'Schedule': 'normal', + 'Depth': 'exclude', + 'Node Kind': 'file', + }, + { + 'Path': re.escape(sbox.ospath('E/alpha')), + 'Schedule': 'delete', + 'Depth': 'exclude', + 'Node Kind': 'unknown', + }, + { + 'Path': re.escape(sbox.ospath('E/beta')), + 'Schedule': 'normal', + 'Depth': 'exclude', + 'Node Kind': 'file', + } + ] + + svntest.actions.run_and_verify_info(expected_info, + sbox.ospath('A/B/E/beta'), + sbox.ospath('E/alpha'), + sbox.ospath('E/beta')) + + ######################################################################## # Run the tests @@ -606,6 +651,7 @@ test_list = [ None, info_show_exclude, binary_tree_conflict, relpath_escaping, + node_hidden_info, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/lock_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/lock_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/lock_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/lock_tests.py Wed Feb 25 08:15:39 2015 @@ -1841,8 +1841,8 @@ def commit_stolen_lock(sbox): err_re, wc_dir) -# When removing directories, the locks of contained files were not -# correctly removed from the working copy database, thus they later +# When removing directories, the locks of contained files were not +# correctly removed from the working copy database, thus they later # magically reappeared when new files or directories with the same # pathes were added. @Issue(4364) @@ -1857,10 +1857,10 @@ def drop_locks_on_parent_deletion(sbox): sbox.simple_lock('A/B/E/alpha') sbox.simple_lock('A/B/E/beta') sbox.simple_rm('A/B') - + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.remove_subtree('A/B') - + svntest.actions.run_and_verify_commit(wc_dir, [], expected_status, @@ -1874,7 +1874,7 @@ def drop_locks_on_parent_deletion(sbox): # The bug also resurrected locks on directories when their path # matched a former file. sbox.simple_mkdir('A/B/E', 'A/B/E/alpha') - + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.tweak('A/B', 'A/B/E', @@ -1883,7 +1883,7 @@ def drop_locks_on_parent_deletion(sbox): 'A/B/lambda', wc_rev='3') expected_status.remove('A/B/E/beta') - + svntest.actions.run_and_verify_commit(wc_dir, [], expected_status, @@ -1997,7 +1997,6 @@ def failing_post_hooks(sbox): 'unlock', pi_path) svntest.actions.run_and_verify_status(wc_dir, expected_status) -@XFail() def break_delete_add(sbox): "break a lock, delete and add the file" @@ -2147,7 +2146,7 @@ def non_root_locks(sbox): 'cp', sbox.repo_url, sbox.repo_url + '/X', '-m', 'copy greek tree') - sbox.simple_switch(sbox.repo_url + '/X') + sbox.simple_switch(sbox.repo_url + '/X') expected_status = svntest.actions.get_virginal_state(wc_dir, 2) svntest.actions.run_and_verify_status(wc_dir, expected_status) @@ -2336,20 +2335,20 @@ def lock_commit_bump(sbox): }) expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.tweak('A/mu', wc_rev=3) - + svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, None, wc_dir) # We explicitly check both the Revision and Last Changed Revision. - expected_infos = [ { + expected_infos = [ { 'Revision' : '1' , 'Last Changed Rev' : '1' , 'URL' : '.*', 'Lock Token' : None, } ] - svntest.actions.run_and_verify_info(expected_infos, + svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('iota')) def copy_dir_with_locked_file(sbox): @@ -2372,6 +2371,98 @@ def copy_dir_with_locked_file(sbox): 'mv', A_url, AA2_url, '-m', '') +@Issue(4557) +@XFail(svntest.main.is_ra_type_dav) +def delete_dir_with_lots_of_locked_files(sbox): + "delete a directory containing lots of locked files" + + sbox.build() + wc_dir = sbox.wc_dir + + # A lot of paths. + nfiles = 75 # NOTE: test XPASSES with 50 files!!! + locked_paths = [] + for i in range(nfiles): + locked_paths.append(sbox.ospath("A/locked_files/file-%i" % i)) + + # Create files at these paths + os.mkdir(sbox.ospath("A/locked_files")) + for file_path in locked_paths: + svntest.main.file_write(file_path, "This is '%s'.\n" % (file_path,)) + sbox.simple_add("A/locked_files") + sbox.simple_commit() + sbox.simple_update() + + # lock all the files + svntest.actions.run_and_verify_svn(None, [], 'lock', + '-m', 'All locks', + *locked_paths) + # Locally delete A + sbox.simple_rm("A") + + # Commit the deletion + # XFAIL: As of 1.8.10, this commit fails with: + # svn: E175002: Unexpected HTTP status 400 'Bad Request' on '<path>' + # and the following error in the httpd error log: + # request failed: error reading the headers + # This problem was introduced on the 1.8.x branch in r1606976. + sbox.simple_commit() + +def delete_locks_on_depth_commit(sbox): + "delete locks on depth-limited commit" + + sbox.build() + wc_dir = sbox.wc_dir + + svntest.actions.run_and_verify_svn(None, [], 'lock', + '-m', 'All files', + *(sbox.ospath(x) + for x in ['iota', 'A/B/E/alpha', + 'A/B/E/beta', 'A/B/lambda', + 'A/D/G/pi', 'A/D/G/rho', + 'A/D/G/tau', 'A/D/H/chi', + 'A/D/H/omega', 'A/D/H/psi', + 'A/D/gamma', 'A/mu'])) + + sbox.simple_rm("A") + + expected_output = svntest.wc.State(wc_dir, { + 'A' : Item(verb='Deleting'), + }) + + expected_status = svntest.wc.State(wc_dir, { + '' : Item(status=' ', wc_rev='1'), + 'iota' : Item(status=' ', wc_rev='1'), + }) + + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status, [], + wc_dir, '--depth', 'immediates') + + sbox.simple_update() # r2 + + svntest.actions.run_and_verify_svn(None, [], 'cp', + sbox.repo_url + '/A@1', sbox.ospath('A')) + + expected_output = [ + 'Adding %s\n' % sbox.ospath('A'), + 'svn: The depth of this commit is \'immediates\', but copies ' \ + 'are always performed recursively in the repository.\n', + 'Committing transaction...\n', + 'Committed revision 3.\n', + ] + + # Verifying the warning line... so can't use verify_commit() + svntest.actions.run_and_verify_svn(expected_output, [], + 'commit', wc_dir, '--depth', 'immediates', + '-mm') + + # Verify that all locks are gone at the server and at the client + expected_status = svntest.actions.get_virginal_state(wc_dir, 3) + expected_status.tweak('', 'iota', wc_rev=2) + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + ######################################################################## # Run the tests @@ -2438,6 +2529,8 @@ test_list = [ None, delete_locked_file_with_percent, lock_commit_bump, copy_dir_with_locked_file, + delete_dir_with_lots_of_locked_files, + delete_locks_on_depth_commit, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/log_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/log_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/log_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/log_tests.py Wed Feb 25 08:15:39 2015 @@ -2618,6 +2618,77 @@ def merge_sensitive_log_xml_reverse_merg svntest.actions.run_and_verify_log_xml(expected_log_attrs=log_attrs, args=['-g', '-r8', D_COPY_path]) +def log_revision_move_copy(sbox): + "log revision handling over move/copy" + + sbox.build() + + sbox.simple_move('iota', 'iotb') + sbox.simple_append('iotb', 'new line\n') + + sbox.simple_copy('A/mu', 'mutb') + sbox.simple_append('mutb', 'mutb\n') + + sbox.simple_move('A/B/E', 'E') + sbox.simple_move('E/alpha', 'alpha') + + #r2 + svntest.actions.run_and_verify_svn(None, [], + 'rm', sbox.repo_url + '/A/D', '-mm') + + sbox.simple_commit() #r3 + + # This introduces a copy and a move in r3, but check how the history + # of these nodes behaves in r2. + + # This one might change behavior once we improve move handling + expected_output = [ + '------------------------------------------------------------------------\n' + ] + expected_err = [] + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'log', '-v',sbox.ospath('iotb'), + '-r2') + + # While this one + expected_output = [] + expected_err = '.*E195012: Unable to find repository location.*' + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'log', '-v', sbox.ospath('mutb'), + '-r2') + + # And just for fun, do the same thing for blame + expected_output = [ + ' 1 jrandom This is the file \'iota\'.\n' + ] + expected_err = [] + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'blame', sbox.ospath('iotb'), + '-r2') + + expected_output = None + expected_err = '.*E195012: Unable to find repository location.*' + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'blame', sbox.ospath('mutb'), + '-r2') + + expected_output = svntest.verify.RegexListOutput([ + '-+\\n', + 'r3\ .*\n', + re.escape('Changed paths:\n'), + re.escape(' D /A/B/E\n'), + re.escape(' A /E (from /A/B/E:2)\n'), # Patched - Direct move + re.escape(' D /E/alpha\n'), + re.escape(' A /alpha (from /A/B/E/alpha:1)\n'), # Indirect move - Not patched + re.escape(' D /iota\n'), + re.escape(' A /iotb (from /iota:2)\n'), # Patched - Direct move + re.escape(' A /mutb (from /A/mu:1)\n'), # Copy (always r1) + '-+\\n' + ]) + svntest.actions.run_and_verify_svn(expected_output, [], + 'log', '-v', '-q', sbox.wc_dir, + '-c3') + ######################################################################## # Run the tests @@ -2667,6 +2738,7 @@ test_list = [ None, log_multiple_revs_spanning_rename, mergeinfo_log, merge_sensitive_log_xml_reverse_merges, + log_revision_move_copy, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tests.py Wed Feb 25 08:15:39 2015 @@ -18505,7 +18505,7 @@ def merge_to_empty_target_merge_to_infin C1_path = sbox.ospath('A/C/C1') test3_path = sbox.ospath('A/C/C1/test.txt') - + # r3 - Add some subtrees: # A /A/B/B1 # A /A/B/B1/B1a Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tree_conflict_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tree_conflict_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tree_conflict_tests.py Wed Feb 25 08:15:39 2015 @@ -1949,6 +1949,159 @@ def merge_replace_on_del_fails(sbox): actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge', sbox.repo_url + '/A', branch_path) +def merge_conflict_details(sbox): + "merge conflict details" + + sbox.build() + wc_dir = sbox.wc_dir + + sbox.simple_append('A/B/E/new', 'new\n') + sbox.simple_add('A/B/E/new') + sbox.simple_append('A/B/E/alpha', '\nextra\nlines\n') + sbox.simple_rm('A/B/E/beta', 'A/B/F') + sbox.simple_propset('key', 'VAL', 'A/B/E', 'A/B') + sbox.simple_mkdir('A/B/E/new-dir1') + sbox.simple_mkdir('A/B/E/new-dir2') + sbox.simple_mkdir('A/B/E/new-dir3') + sbox.simple_rm('A/B/lambda') + sbox.simple_mkdir('A/B/lambda') + sbox.simple_commit() + + sbox.simple_update('', 1) + + sbox.simple_move('A/B', 'B') + + sbox.simple_propset('key', 'vAl', 'B') + sbox.simple_move('B/E/beta', 'beta') + sbox.simple_propset('a', 'b', 'B/F', 'B/lambda') + sbox.simple_append('B/E/alpha', 'other\nnew\nlines') + sbox.simple_mkdir('B/E/new') + sbox.simple_mkdir('B/E/new-dir1') + sbox.simple_append('B/E/new-dir2', 'something') + sbox.simple_append('B/E/new-dir3', 'something') + sbox.simple_add('B/E/new-dir3') + + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.add({ + 'B' : Item(status=' C', copied='+', moved_from='A/B', + wc_rev='-', entry_status='AC'), + 'B/E' : Item(status=' M', copied='+', wc_rev='-'), + 'B/E/new' : Item(status='A ', treeconflict='C', wc_rev='-'), + 'B/E/beta' : Item(status='D ', copied='+', treeconflict='C', + wc_rev='-', moved_to='beta'), + 'B/E/alpha' : Item(status='C ', copied='+', wc_rev='-'), + 'B/E/new-dir3' : Item(status='A ', treeconflict='C', wc_rev='-'), + 'B/E/new-dir1' : Item(status='A ', treeconflict='C', wc_rev='-'), + 'B/F' : Item(status=' M', copied='+', treeconflict='C', + wc_rev='-'), + 'B/lambda' : Item(status=' M', copied='+', treeconflict='C', + wc_rev='-'), + 'beta' : Item(status='A ', copied='+', + moved_from='B/E/beta', wc_rev='-') + }) + expected_status.tweak('A/B', status='D ', wc_rev='1', moved_to='B') + expected_status.tweak('A/B/lambda', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', + 'A/B/F', status='D ') + + expected_output = svntest.wc.State(wc_dir, { + 'B' : Item(status=' C'), + 'B/E' : Item(status=' U'), + 'B/E/new' : Item(status=' ', treeconflict='C'), + 'B/E/beta' : Item(status=' ', treeconflict='C'), + 'B/E/alpha' : Item(status='C '), + 'B/E/new-dir3' : Item(status=' ', treeconflict='C'), + 'B/E/new-dir1' : Item(status=' ', treeconflict='C'), + 'B/F' : Item(status=' ', treeconflict='C'), + 'B/lambda' : Item(status=' ', treeconflict='C'), + }) + expected_skip = wc.State(wc_dir, { + 'B/E/new-dir2' : Item(verb='Skipped'), + }) + svntest.actions.run_and_verify_merge(sbox.ospath('B'), + 1, 2, '^/A/B', '^/A/B', + expected_output, + None, None, + None, None, expected_skip) + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + expected_info = [ + { + "Path" : re.escape(sbox.ospath('B')), + + "Conflict Properties File" : + re.escape(sbox.ospath('B/dir_conflicts.prej')) + '.*', + "Conflict Details": re.escape( + 'incoming dir edit upon merge' + + ' Source left: (dir) ^/A/B@1' + + ' Source right: (dir) ^/A/B@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E')), + }, + { + "Path" : re.escape(sbox.ospath('B/E/alpha')), + "Conflict Previous Base File" : '.*alpha.*', + "Conflict Previous Working File" : '.*alpha.*', + "Conflict Current Base File": '.*alpha.*', + "Conflict Details": re.escape( + 'incoming file edit upon merge' + + ' Source left: (file) ^/A/B/E/alpha@1' + + ' Source right: (file) ^/A/B/E/alpha@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/beta')), + "Tree conflict": re.escape( + 'local file moved away, incoming file delete or move upon merge' + + ' Source left: (file) ^/A/B/E/beta@1' + + ' Source right: (none) ^/A/B/E/beta@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new')), + "Tree conflict": re.escape( + 'local dir add, incoming file add upon merge' + + ' Source left: (none) ^/A/B/E/new@1' + + ' Source right: (file) ^/A/B/E/new@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new-dir1')), + "Tree conflict": re.escape( + 'local dir add, incoming dir add upon merge' + + ' Source left: (none) ^/A/B/E/new-dir1@1' + + ' Source right: (dir) ^/A/B/E/new-dir1@2') + }, + #{ ### Skipped + # "Path" : re.escape(sbox.ospath('B/E/new-dir2')), + # "Tree conflict": re.escape( + # 'local file unversioned, incoming dir add upon merge' + + # ' Source left: (none) ^/A/B/E/new-dir2@1' + + # ' Source right: (dir) ^/A/B/E/new-dir2@2') + #}, + { + "Path" : re.escape(sbox.ospath('B/E/new-dir3')), + "Tree conflict": re.escape( + 'local file add, incoming dir add upon merge' + + ' Source left: (none) ^/A/B/E/new-dir3@1' + + ' Source right: (dir) ^/A/B/E/new-dir3@2') + }, + { + "Path" : re.escape(sbox.ospath('B/F')), + "Tree conflict": re.escape( + 'local dir edit, incoming dir delete or move upon merge' + + ' Source left: (dir) ^/A/B/F@1' + + ' Source right: (none) ^/A/B/F@2') + }, + { + "Path" : re.escape(sbox.ospath('B/lambda')), + "Tree conflict": re.escape( + 'local file edit, incoming replace with dir upon merge' + + ' Source left: (file) ^/A/B/lambda@1' + + ' Source right: (dir) ^/A/B/lambda@2') + }, + ] + + svntest.actions.run_and_verify_info(expected_info, sbox.ospath('B'), + '--depth', 'infinity') + ######################################################################## # Run the tests @@ -1979,6 +2132,7 @@ test_list = [ None, merge_replace_causes_tree_conflict, merge_replace_causes_tree_conflict2, merge_replace_on_del_fails, + merge_conflict_details, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/move_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/move_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/move_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/move_tests.py Wed Feb 25 08:15:39 2015 @@ -853,13 +853,13 @@ def build_simple_file_move_func(sbox, so mv_info_src = [ { 'Path' : re.escape(source_path), - 'Moved To' : re.escape(dest), + 'Moved To' : re.escape(sbox.ospath(dest)), } ] mv_info_dst = [ { 'Path' : re.escape(dest_path), - 'Moved From' : re.escape(source), + 'Moved From' : re.escape(sbox.ospath(source)), } ] @@ -1156,23 +1156,11 @@ def move_missing(sbox): expected_status.tweak('A/D/G', 'A/D/G/tau', 'A/D/G/pi', 'A/D/G/rho', status='! ', entry_status=' ') - expected_status.add({ - 'R' : Item(status='! ', wc_rev='-', - entry_status='A ', entry_copied='+'), - 'R/pi' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - 'R/tau' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - 'R/rho' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - }) - # Verify that the status processing doesn't crash svntest.actions.run_and_verify_status(wc_dir, expected_status) # The issue is a crash when the destination is present os.mkdir(sbox.ospath('R')) - expected_status.tweak('R', status='A ', copied='+') svntest.actions.run_and_verify_status(wc_dir, expected_status) @@ -1373,7 +1361,7 @@ def move_many_update_delete(sbox): svntest.actions.run_and_verify_update(wc_dir, expected_output, None, expected_status) - # Would be nice if we could run the resolver as a separate step, + # Would be nice if we could run the resolver as a separate step, # but 'svn resolve' just fails for any value but working def move_many_update_add(sbox): @@ -1483,7 +1471,7 @@ def copy_move_commit(sbox): # create table bbb (Id int not null) # - Commit # Repro Issue 2 - # - Copy folder aaa under same parent folder (i.e. as a sibling). (using Ctrl drag/drop). + # - Copy folder aaa under same parent folder (i.e. as a sibling). (using Ctrl drag/drop). # Creates Copy of aaa # - Rename Copy of aaa to eee # - Commit @@ -1512,7 +1500,7 @@ def move_to_from_external(sbox): 'move', sbox.ospath('iota'), sbox.ospath('GG/tau')) - + svntest.actions.run_and_verify_svn(None, [], 'ci', '-m', 'Commit both', sbox.ospath(''), @@ -1566,6 +1554,148 @@ def revert_del_root_of_move(sbox): expected_status.tweak('A/B/E', treeconflict='C') svntest.actions.run_and_verify_status(wc_dir, expected_status) +def move_conflict_details(sbox): + "move conflict details" + + sbox.build() + + sbox.simple_append('A/B/E/new', 'new\n') + sbox.simple_add('A/B/E/new') + sbox.simple_append('A/B/E/alpha', '\nextra\nlines\n') + sbox.simple_rm('A/B/E/beta', 'A/B/F') + sbox.simple_propset('key', 'VAL', 'A/B/E', 'A/B') + sbox.simple_mkdir('A/B/E/new-dir1') + sbox.simple_mkdir('A/B/E/new-dir2') + sbox.simple_mkdir('A/B/E/new-dir3') + sbox.simple_rm('A/B/lambda') + sbox.simple_mkdir('A/B/lambda') + sbox.simple_commit() + + sbox.simple_update('', 1) + + sbox.simple_move('A/B', 'B') + + sbox.simple_update('', 2) + + expected_info = [ + { + "Moved To": re.escape(sbox.ospath("B")), + "Tree conflict": re.escape( + 'local dir moved away, incoming dir edit upon update' + + ' Source left: (dir) ^/A/B@1' + + ' Source right: (dir) ^/A/B@2') + } + ] + svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B')) + + sbox.simple_propset('key', 'vAl', 'B') + sbox.simple_move('B/E/beta', 'beta') + sbox.simple_propset('a', 'b', 'B/F', 'B/lambda') + sbox.simple_append('B/E/alpha', 'other\nnew\nlines') + sbox.simple_mkdir('B/E/new') + sbox.simple_mkdir('B/E/new-dir1') + sbox.simple_append('B/E/new-dir2', 'something') + sbox.simple_append('B/E/new-dir3', 'something') + sbox.simple_add('B/E/new-dir3') + + + expected_output = [ + " C %s\n" % sbox.ospath('B'), # Property conflicted + " U %s\n" % sbox.ospath('B/E'), # Just updated + "C %s\n" % sbox.ospath('B/E/alpha'), # Text conflicted + " C %s\n" % sbox.ospath('B/E/beta'), + " C %s\n" % sbox.ospath('B/E/new'), + " C %s\n" % sbox.ospath('B/E/new-dir1'), + " C %s\n" % sbox.ospath('B/E/new-dir2'), + " C %s\n" % sbox.ospath('B/E/new-dir3'), + " C %s\n" % sbox.ospath('B/F'), + " C %s\n" % sbox.ospath('B/lambda'), + "Updated to revision 2.\n", + "Resolved conflicted state of '%s'\n" % sbox.ospath('A/B') + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'resolve', sbox.ospath('A/B'), + '--depth', 'empty', + '--accept', 'mine-conflict') + + expected_info = [ + { + "Path" : re.escape(sbox.ospath('B')), + + "Conflict Properties File" : + re.escape(sbox.ospath('B/dir_conflicts.prej')) + '.*', + "Conflict Details": re.escape( + 'incoming dir edit upon update' + + ' Source left: (dir) ^/A/B@1' + + ' Source right: (dir) ^/A/B@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E')), + }, + { + "Path" : re.escape(sbox.ospath('B/E/alpha')), + "Conflict Previous Base File" : '.*alpha.*', + "Conflict Previous Working File" : '.*alpha.*', + "Conflict Current Base File": '.*alpha.*', + "Conflict Details": re.escape( + 'incoming file edit upon update' + + ' Source left: (file) ^/A/B/E/alpha@1' + + ' Source right: (file) ^/A/B/E/alpha@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/beta')), + "Tree conflict": re.escape( + 'local file moved away, incoming file delete or move upon update' + + ' Source left: (file) ^/A/B/E/beta@1' + + ' Source right: (none) ^/A/B/E/beta@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new')), + "Tree conflict": re.escape( + 'local dir add, incoming file add upon update' + + ' Source left: (none) ^/A/B/E/new@1' + + ' Source right: (file) ^/A/B/E/new@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new-dir1')), + "Tree conflict": re.escape( + 'local dir add, incoming dir add upon update' + + ' Source left: (none) ^/A/B/E/new-dir1@1' + + ' Source right: (dir) ^/A/B/E/new-dir1@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new-dir2')), + "Tree conflict": re.escape( + 'local file unversioned, incoming dir add upon update' + + ' Source left: (none) ^/A/B/E/new-dir2@1' + + ' Source right: (dir) ^/A/B/E/new-dir2@2') + }, + { + "Path" : re.escape(sbox.ospath('B/E/new-dir3')), + "Tree conflict": re.escape( + 'local file add, incoming dir add upon update' + + ' Source left: (none) ^/A/B/E/new-dir3@1' + + ' Source right: (dir) ^/A/B/E/new-dir3@2') + }, + { + "Path" : re.escape(sbox.ospath('B/F')), + "Tree conflict": re.escape( + 'local dir edit, incoming dir delete or move upon update' + + ' Source left: (dir) ^/A/B/F@1' + + ' Source right: (none) ^/A/B/F@2') + }, + { + "Path" : re.escape(sbox.ospath('B/lambda')), + "Tree conflict": re.escape( + 'local file edit, incoming replace with dir upon update' + + ' Source left: (file) ^/A/B/lambda@1' + + ' Source right: (dir) ^/A/B/lambda@2') + }, + ] + + svntest.actions.run_and_verify_info(expected_info, sbox.ospath('B'), + '--depth', 'infinity') + ####################################################################### # Run the tests @@ -1585,6 +1715,7 @@ test_list = [ None, copy_move_commit, move_to_from_external, revert_del_root_of_move, + move_conflict_details, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/prop_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/prop_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/prop_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/prop_tests.py Wed Feb 25 08:15:39 2015 @@ -2747,8 +2747,8 @@ def dir_prop_conflict_details(sbox): # The conflict properties file line was shown for previous versions, but the # conflict source urls are new since 1.8. expected_info = { - 'Conflict Properties File' : re.escape(os.path.abspath( - sbox.ospath('A/dir_conflicts.prej')) + 'Conflict Properties File' : re.escape(sbox.ospath('A/dir_conflicts.prej')), + 'Conflict Details': re.escape('incoming dir edit upon update' + ' Source left: (dir) ^/A@1' + ' Source right: (dir) ^/A@2') } Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/redirect_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/redirect_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/redirect_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/redirect_tests.py Wed Feb 25 08:15:39 2015 @@ -154,7 +154,7 @@ def redirected_nonroot_update(sbox): checkout_url, wc_dir) if err: raise svntest.Failure - + # Relocate (by cheating) the working copy to the redirect URL. When # we then update, we'll expect to find ourselves automagically back # to the original URL. (This is because we can't easily introduce a @@ -241,6 +241,25 @@ def redirected_copy(sbox): sbox.redirected_root_url(temporary=True) + '/A', '^/copy-of-A') #---------------------------------------------------------------------- +@SkipUnless(svntest.main.is_ra_type_dav) +def redirected_commands(sbox): + "redirected commands" + + sbox.build(create_wc=False) + + svntest.actions.run_and_verify_svn(None, [], + 'log', + sbox.redirected_root_url() + '/A') + + svntest.actions.run_and_verify_svn(None, [], + 'ls', + sbox.redirected_root_url() + '/A') + + svntest.actions.run_and_verify_svn(None, [], + 'info', + sbox.redirected_root_url() + '/A') + +#---------------------------------------------------------------------- ######################################################################## # Run the tests @@ -253,6 +272,7 @@ test_list = [ None, redirected_nonroot_update, redirected_externals, redirected_copy, + redirected_commands, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/special_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/special_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/special_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/special_tests.py Wed Feb 25 08:15:39 2015 @@ -612,31 +612,70 @@ def replace_symlink_with_dir(sbox): # test for issue #1808: svn up deletes local symlink that obstructs # versioned file @Issue(1808) -@SkipUnless(svntest.main.is_posix_os) def update_obstructing_symlink(sbox): "symlink obstructs incoming delete" sbox.build() wc_dir = sbox.wc_dir - mu_path = os.path.join(wc_dir, 'A', 'mu') - mu_url = sbox.repo_url + '/A/mu' - iota_path = os.path.join(wc_dir, 'iota') - - # delete A/mu and replace it with a symlink - svntest.main.run_svn(None, 'rm', mu_path) - os.symlink(iota_path, mu_path) + mu_path = sbox.ospath('A/mu') - svntest.main.run_svn(None, 'rm', mu_url, - '-m', 'log msg') + iota_abspath = os.path.abspath(sbox.ospath('iota')) - svntest.main.run_svn(None, - 'up', wc_dir) + # delete mu and replace it with an (not-added) symlink + sbox.simple_rm('A/mu') + sbox.simple_symlink(iota_abspath, 'A/mu') + + # delete pi and replace it with an added symlink + sbox.simple_rm('A/D/G/pi') + sbox.simple_add_symlink(iota_abspath, 'A/D/G/pi') + + if not os.path.exists(mu_path): + raise svntest.Failure("mu should be there") + + # Now remove mu and pi in the repository + svntest.main.run_svn(None, 'rm', '-m', 'log msg', + sbox.repo_url + '/A/mu', + sbox.repo_url + '/A/D/G/pi') + + # We expect tree conflicts + expected_output = svntest.wc.State(wc_dir, { + 'A/mu': Item(status=' ', treeconflict='C'), + 'A/D/G/pi': Item(status=' ', treeconflict='C') + }) + + expected_status = svntest.actions.get_virginal_state(wc_dir, 2) + expected_status.tweak('A/mu', status='? ', treeconflict='C', + wc_rev=None) + + expected_status.tweak('A/D/G/pi', status='A ',treeconflict='C', + wc_rev='-') + + svntest.actions.run_and_verify_update(wc_dir, + expected_output, None, + expected_status) + + expected_info = [ + { + 'Path': re.escape(sbox.ospath('A/D/G/pi')), + 'Tree conflict': 'local file replace, incoming file delete or move.*' + }, + { + 'Path': re.escape(sbox.ospath('A/mu')), + 'Tree conflict': 'local file delete, incoming file delete or move.*' + } + ] + + svntest.actions.run_and_verify_info(expected_info, + sbox.ospath('A/D/G/pi'), + sbox.ospath('A/mu')) # check that the symlink is still there - target = os.readlink(mu_path) - if target != iota_path: - raise svntest.Failure - + if not os.path.exists(mu_path): + raise svntest.Failure("mu should be there") + if svntest.main.is_posix_os(): + target = os.readlink(mu_path) + if target != iota_abspath: + raise svntest.Failure("mu no longer points to the same location") def warn_on_reserved_name(sbox): "warn when attempt operation on a reserved name" Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/stat_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/stat_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/stat_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/stat_tests.py Wed Feb 25 08:15:39 2015 @@ -2093,12 +2093,12 @@ def status_path_handling(sbox): def status_move_missing_direct(sbox): "move information when status is called directly" - + sbox.build() sbox.simple_copy('A', 'Z') sbox.simple_commit('') sbox.simple_update('') - + sbox.simple_move('Z', 'ZZ') sbox.simple_move('A', 'Z') sbox.simple_move('Z/B', 'ZB') @@ -2108,14 +2108,14 @@ def status_move_missing_direct(sbox): # Somehow 'svn status' now shows different output for 'ZB/E' # when called directly and via an ancestor, as this handles # multi-layer in a different way - + # Note that the status output may change over different Subversion revisions, # but the status on a node should be identical anyway 'svn status' is called # on it. - + expected_output = [ 'A + %s\n' % sbox.ospath('ZB'), - ' > moved from %s\n' % os.path.join('..', 'Z', 'B'), + ' > moved from %s\n' % os.path.join('..', 'Z', 'B'), 'D + %s\n' % sbox.ospath('ZB/E'), ' > moved to %s\n' % os.path.join('..', 'Z', 'B', 'E'), ] @@ -2133,7 +2133,7 @@ def status_move_missing_direct(sbox): def status_move_missing_direct_base(sbox): "move when status is called directly with base" - + sbox.build() sbox.simple_copy('A', 'Z') sbox.simple_mkdir('Q') @@ -2141,10 +2141,10 @@ def status_move_missing_direct_base(sbox sbox.simple_mkdir('Q/ZB/E') sbox.simple_commit('') sbox.simple_update('') - + sbox.simple_rm('Q') sbox.simple_mkdir('Q') - + sbox.simple_move('Z', 'ZZ') sbox.simple_move('A', 'Z') sbox.simple_move('Z/B', 'Q/ZB') @@ -2154,14 +2154,14 @@ def status_move_missing_direct_base(sbox # Somehow 'svn status' now shows different output for 'Q/ZB/E' # when called directly and via an ancestor, as this handles # multi-layer in a different way - + # Note that the status output may change over different Subversion revisions, # but the status on a node should be identical anyway 'svn status' is called # on it. - + # This test had a different result as status_move_missing_direct at the time of # writing this test. - + expected_output = [ 'A + %s\n' % sbox.ospath('Q/ZB'), ' > moved from %s\n' % os.path.join('..', '..', 'Z', 'B'), Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnadmin_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnadmin_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnadmin_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnadmin_tests.py Wed Feb 25 08:15:39 2015 @@ -82,6 +82,10 @@ def check_hotcopy_fsfs_fsx(src, dst): if dst_dirent == 'write-lock': continue + # Ignore auto-created rep-cache.db-journal file + if dst_dirent == 'rep-cache.db-journal': + continue + src_dirent = os.path.join(src_dirpath, dst_dirent) if not os.path.exists(src_dirent): raise svntest.Failure("%s does not exist in hotcopy " @@ -96,6 +100,10 @@ def check_hotcopy_fsfs_fsx(src, dst): if src_file == 'write-lock': continue + # Ignore auto-created rep-cache.db-journal file + if src_file == 'rep-cache.db-journal': + continue + src_path = os.path.join(src_dirpath, src_file) dst_path = os.path.join(dst_dirpath, src_file) if not os.path.isfile(dst_path): @@ -179,7 +187,7 @@ def check_hotcopy_fsfs(src, dst): def check_hotcopy_fsx(src, dst): "Verify that the SRC FSX repository has been correctly copied to DST." check_hotcopy_fsfs_fsx(src, dst) - + #---------------------------------------------------------------------- # How we currently test 'svnadmin' -- @@ -2051,7 +2059,7 @@ def verify_keep_going(sbox): svntest.actions.run_and_verify_svn(None, [], 'mkdir', '-m', 'log_msg', C_url) - + r2 = fsfs_file(sbox.repo_dir, 'revs', '2') fp = open(r2, 'r+b') fp.write("""inserting junk to corrupt the rev""") @@ -2922,6 +2930,30 @@ def load_txdelta(sbox): ".*Verified revision *"): raise svntest.Failure +@Issues(4563) +def load_no_svndate_r0(sbox): + "load without svn:date on r0" + + sbox.build(create_wc=False, empty=True) + + # svn:date exits + svntest.actions.run_and_verify_svnlook([' svn:date\n'], [], + 'proplist', '--revprop', '-r0', + sbox.repo_dir) + + dump_old = ["SVN-fs-dump-format-version: 2\n", "\n", + "UUID: bf52886d-358d-4493-a414-944a6e5ad4f5\n", "\n", + "Revision-number: 0\n", + "Prop-content-length: 10\n", + "Content-length: 10\n", "\n", + "PROPS-END\n", "\n"] + svntest.actions.run_and_verify_load(sbox.repo_dir, dump_old) + + # svn:date should have been removed + svntest.actions.run_and_verify_svnlook([], [], + 'proplist', '--revprop', '-r0', + sbox.repo_dir) + ######################################################################## # Run the tests @@ -2976,6 +3008,7 @@ test_list = [ None, freeze_same_uuid, upgrade, load_txdelta, + load_no_svndate_r0, ] if __name__ == '__main__': Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/actions.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/actions.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/actions.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/actions.py Wed Feb 25 08:15:39 2015 @@ -1019,19 +1019,20 @@ def run_and_verify_info(expected_infos, for actual, expected in zip(actual_infos, expected_infos): # compare dicts + path = actual['Path'] for key, value in expected.items(): assert ':' not in key # caller passed impossible expectations? if value is None and key in actual: - raise main.SVNLineUnequal("Found unexpected key '%s' with value '%s'" - % (key, actual[key])) + raise main.SVNLineUnequal("On '%s': Found unexpected key '%s'\n Value '%s'" + % (path, key, actual[key])) if value is not None and key not in actual: - raise main.SVNLineUnequal("Expected key '%s' (with value '%s') " - "not found" % (key, value)) + raise main.SVNLineUnequal("On '%s': Expected key '%s' not found\n Expected value '%s'" + % (path, key, value)) if value is not None and not re.match(value, actual[key]): - raise verify.SVNUnexpectedStdout("Values of key '%s' don't match:\n" + raise verify.SVNUnexpectedStdout("On '%s': Values of key '%s' don't match:\n" " Expected: '%s' (regex)\n" " Found: '%s' (string)\n" - % (key, value, actual[key])) + % (path, key, value, actual[key])) except: sys.stderr.write("Bad 'svn info' output:\n" @@ -1523,7 +1524,7 @@ def run_and_verify_status(wc_dir_name, s exit_code, output, errput = main.run_svn(None, 'status', '-v', '-u', '-q', wc_dir_name) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc_dir_name) # Verify actual output against expected output. if isinstance(status_tree, wc.State): @@ -1568,7 +1569,7 @@ def run_and_verify_unquiet_status(wc_dir exit_code, output, errput = main.run_svn(None, 'status', '-v', '-u', wc_dir_name) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc_dir_name) # Verify actual output against expected output. if isinstance(status_tree, wc.State): Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/factory.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/factory.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/factory.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/factory.py Wed Feb 25 08:15:39 2015 @@ -1035,7 +1035,7 @@ class TestFactory: make_py, prev_status = self.get_prev_status(wc) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc.realpath) # The tests currently compare SVNTreeNode trees, so let's do that too. prev_status_tree = prev_status.old_tree() Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/main.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/main.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/main.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/main.py Wed Feb 25 08:15:39 2015 @@ -54,7 +54,7 @@ import svntest from svntest import Failure from svntest import Skip -SVN_VER_MINOR = 9 +SVN_VER_MINOR = 10 ###################################################################### # Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/sandbox.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/sandbox.py Wed Feb 25 08:15:39 2015 @@ -381,15 +381,18 @@ class Sandbox: raise Exception("Unexpected line '" + line + "' in proplist output" + str(out)) return props - def simple_add_symlink(self, dest, target): - """Create a symlink TARGET pointing to DEST and add it to subversion""" + def simple_symlink(self, dest, target): + """Create a symlink TARGET pointing to DEST""" if svntest.main.is_posix_os(): os.symlink(dest, self.ospath(target)) else: svntest.main.file_write(self.ospath(target), "link %s" % dest) + + def simple_add_symlink(self, dest, target, add=True): + """Create a symlink TARGET pointing to DEST and add it to subversion""" + self.simple_symlink(dest, target) self.simple_add(target) - if not svntest.main.is_posix_os(): - # '*' is evaluated on Windows + if not svntest.main.is_posix_os(): # '*' is evaluated on Windows self.simple_propset('svn:special', 'X', target) def simple_add_text(self, text, *targets): @@ -424,7 +427,7 @@ class Sandbox: def simple_append(self, dest, contents, truncate=False): """Append CONTENTS to file DEST, optionally truncating it first. DEST is a relpath relative to the WC.""" - open(self.ospath(dest), truncate and 'w' or 'a').write(contents) + open(self.ospath(dest), truncate and 'wb' or 'ab').write(contents) def simple_lock(self, *targets): """Lock TARGETS in the WC. Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/wc.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/wc.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/wc.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/wc.py Wed Feb 25 08:15:39 2015 @@ -434,7 +434,7 @@ class State: return not self.__eq__(other) @classmethod - def from_status(cls, lines): + def from_status(cls, lines, wc_dir=None): """Create a State object from 'svn status' output.""" def not_space(value): @@ -442,6 +442,17 @@ class State: return value return None + def parse_move(path, wc_dir): + if path.startswith('../'): + # ../ style paths are relative from the status root + return to_relpath(os.path.normpath(repos_join(wc_dir, path))) + else: + # Other paths are just relative from cwd + return to_relpath(path) + + if not wc_dir: + wc_dir = '' + desc = { } last = None for line in lines: @@ -455,15 +466,15 @@ class State: if ex_match: if ex_match.group('moved_from'): - path = ex_match.group('moved_from') - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('moved_from')) + last.tweak(moved_from = parse_move(path, wc_dir)) elif ex_match.group('moved_to'): - path = ex_match.group('moved_to') - last.tweak(moved_to = to_relpath(path)) + path = to_relpath(ex_match.group('moved_to')) + last.tweak(moved_to = parse_move(path, wc_dir)) elif ex_match.group('swapped_with'): - path = ex_match.group('swapped_with') - last.tweak(moved_to = to_relpath(path)) - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('swapped_with')) + last.tweak(moved_to = parse_move(path, wc_dir)) + last.tweak(moved_from = parse_move(path, wc_dir)) # Parse TC description? Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/switch_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/switch_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/switch_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/switch_tests.py Wed Feb 25 08:15:39 2015 @@ -2048,7 +2048,7 @@ def tolerate_local_mods(sbox): svntest.main.file_write(LM_path, 'Locally modified file.\n', 'w+') expected_output = svntest.wc.State(wc_dir, { - 'A/L' : Item(status='D '), + 'A/L' : Item(status=' ', treeconflict='C'), }) expected_disk = svntest.main.greek_state.copy() @@ -2060,6 +2060,9 @@ def tolerate_local_mods(sbox): expected_status = svntest.actions.get_virginal_state(wc_dir, 3) expected_status.tweak('', 'iota', wc_rev=1) expected_status.tweak('A', switched='S') + expected_status.add({ + 'A/L' : Item(status='A ', copied='+', treeconflict='C', wc_rev='-') + }) # Used to fail with locally modified or unversioned files svntest.actions.run_and_verify_switch(wc_dir, A_path, A2_url, @@ -2121,7 +2124,7 @@ def tree_conflicts_on_switch_1_1(sbox): 'DDF/D1/D2' : Item(status=' ', treeconflict='U'), 'DDF/D1/D2/gamma' : Item(status=' ', treeconflict='U') }) - + expected_disk = svntest.wc.State('', { 'F' : Item(), 'D' : Item(), @@ -2391,12 +2394,12 @@ def tree_conflicts_on_switch_2_2(sbox): expected_output = deep_trees_conflict_output expected_disk = svntest.wc.State('', { + 'DDF/D1/D2' : Item(), 'F' : Item(), 'D' : Item(), - 'DF' : Item(), - 'DD' : Item(), - 'DDF' : Item(), - 'DDD' : Item(), + 'DF/D1' : Item(), + 'DD/D1' : Item(), + 'DDD/D1/D2' : Item(), }) expected_status = svntest.deeptrees.deep_trees_virginal_state.copy() @@ -2408,20 +2411,16 @@ def tree_conflicts_on_switch_2_2(sbox): # Expect the incoming tree deletes and the local leaf deletes to mean # that all deleted paths are *really* gone, not simply scheduled for # deletion. - expected_status.tweak('F/alpha', - 'D/D1', - 'DD/D1', - 'DF/D1', - 'DDD/D1', - 'DDF/D1', + expected_status.tweak('DD/D1', 'DF/D1', 'DDF/D1', 'DDD/D1', + status='A ', copied='+', treeconflict='C', + wc_rev='-') + expected_status.tweak('DDF/D1/D2', 'DDD/D1/D2', + copied='+', wc_rev='-') + expected_status.tweak('DD/D1/D2', 'DF/D1/beta', 'DDD/D1/D2/D3', + 'DDF/D1/D2/gamma', + status='D ', copied='+', wc_rev='-') + expected_status.tweak('F/alpha', 'D/D1', status='! ', treeconflict='C', wc_rev=None) - # Remove from expected status and disk everything below the deleted paths. - expected_status.remove('DD/D1/D2', - 'DF/D1/beta', - 'DDD/D1/D2', - 'DDD/D1/D2/D3', - 'DDF/D1/D2', - 'DDF/D1/D2/gamma',) expected_info = { 'F/alpha' : { @@ -2432,13 +2431,13 @@ def tree_conflicts_on_switch_2_2(sbox): }, 'DF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DF/D1@2' + ' Source right: .none.*(/DF/D1@3)?$', }, 'DDF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DDF/D1@2' + ' Source right: .none.*(/DDF/D1@3)?$', }, @@ -2450,13 +2449,13 @@ def tree_conflicts_on_switch_2_2(sbox): }, 'DD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DD/D1@2' + ' Source right: .none.*(/DD/D1@3)?$', }, 'DDD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DDD/D1@2' + ' Source right: .none.*(/DDD/D1@3)?$', }, Modified: subversion/branches/reuse-ra-session/subversion/tests/cmdline/tree_conflict_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/tests/cmdline/tree_conflict_tests.py?rev=1662177&r1=1662176&r2=1662177&view=diff ============================================================================== --- subversion/branches/reuse-ra-session/subversion/tests/cmdline/tree_conflict_tests.py (original) +++ subversion/branches/reuse-ra-session/subversion/tests/cmdline/tree_conflict_tests.py Wed Feb 25 08:15:39 2015 @@ -1449,7 +1449,6 @@ def update_dir_with_not_present(sbox): run_and_verify_svn(None, [], 'ci', '-m', '', wc_dir) -@XFail() def update_delete_mixed_rev(sbox): "update that deletes mixed-rev" @@ -1484,6 +1483,10 @@ def update_delete_mixed_rev(sbox): status='A ', copied='+', treeconflict='C', wc_rev='-') expected_status.tweak('A/B/F', 'A/B/E', 'A/B/E/beta', 'A/B/lambda', copied='+', wc_rev='-') + + # The entries world doesn't see a changed revision as another add + # while the WC-NG world does... + expected_status.tweak('A/B/E', status='A ', entry_status=' ') run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status, None, None, None, None, None, 1,
