diff options
Diffstat (limited to 'subversion/tests/cmdline/relocate_tests.py')
-rwxr-xr-x | subversion/tests/cmdline/relocate_tests.py | 67 |
1 files changed, 26 insertions, 41 deletions
diff --git a/subversion/tests/cmdline/relocate_tests.py b/subversion/tests/cmdline/relocate_tests.py index 7e6ea19..40ffb49 100755 --- a/subversion/tests/cmdline/relocate_tests.py +++ b/subversion/tests/cmdline/relocate_tests.py @@ -42,7 +42,7 @@ Item = svntest.wc.StateItem from svntest.main import SVN_PROP_MERGEINFO, server_has_mergeinfo from externals_tests import change_external -from switch_tests import do_routine_switching +from svntest.deeptrees import do_routine_switching #---------------------------------------------------------------------- @@ -53,7 +53,7 @@ def relocate_deleted_missing_copied(sbox): # Delete A/mu to create a deleted entry for mu in A/.svn/entries mu_path = os.path.join(wc_dir, 'A', 'mu') - svntest.actions.run_and_verify_svn(None, None, [], 'rm', mu_path) + svntest.actions.run_and_verify_svn(None, [], 'rm', mu_path) expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.remove('A/mu') expected_output = svntest.wc.State(wc_dir, { @@ -61,8 +61,7 @@ def relocate_deleted_missing_copied(sbox): }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, wc_dir) + expected_status) # Remove A/B/F to create a missing entry svntest.main.safe_rmtree(os.path.join(wc_dir, 'A', 'B', 'F')) @@ -70,11 +69,11 @@ def relocate_deleted_missing_copied(sbox): # Copy A/D to A/D2 D_path = os.path.join(wc_dir, 'A', 'D') D2_path = os.path.join(wc_dir, 'A', 'D2') - svntest.actions.run_and_verify_svn(None, None, [], 'copy', + svntest.actions.run_and_verify_svn(None, [], 'copy', D_path, D2_path) # Delete within the copy D2G_path = os.path.join(wc_dir, 'A', 'D2', 'G') - svntest.actions.run_and_verify_svn(None, None, [], 'rm', D2G_path) + svntest.actions.run_and_verify_svn(None, [], 'rm', D2G_path) expected_status.add({ 'A/D2' : Item(status='A ', wc_rev='-', copied='+'), @@ -97,7 +96,7 @@ def relocate_deleted_missing_copied(sbox): other_repo_dir, other_repo_url = sbox.add_repo_path('other') svntest.main.copy_repos(repo_dir, other_repo_dir, 2, 0) svntest.main.safe_rmtree(repo_dir, 1) - svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate', + svntest.actions.run_and_verify_svn(None, [], 'switch', '--relocate', repo_url, other_repo_url, wc_dir) # Deleted and missing entries should be preserved, so update should @@ -141,8 +140,7 @@ def relocate_deleted_missing_copied(sbox): status=' ', wc_rev='3', copied=None) expected_status.remove('A/D2/G', 'A/D2/G/pi', 'A/D2/G/rho', 'A/D2/G/tau') svntest.actions.run_and_verify_commit(wc_dir, - expected_output, expected_status, - None, wc_dir) + expected_output, expected_status) #---------------------------------------------------------------------- @@ -163,26 +161,26 @@ def relocate_beyond_repos_root(sbox): other_B_url = other_repo_url + "/B" svntest.main.safe_rmtree(wc_dir, 1) - svntest.actions.run_and_verify_svn(None, None, [], 'checkout', + svntest.actions.run_and_verify_svn(None, [], 'checkout', repo_url + '/A', wc_dir) svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0) # A relocate that changes the repo path part of the URL shouldn't work. # This tests for issue #2380. - svntest.actions.run_and_verify_svn(None, None, + svntest.actions.run_and_verify_svn(None, ".*Invalid relocation destination.*", 'relocate', A_url, other_B_url, A_wc_dir) # Another way of trying to change the fs path, leading to an invalid # repository root. - svntest.actions.run_and_verify_svn(None, None, + svntest.actions.run_and_verify_svn(None, ".*is not the root.*", 'relocate', repo_url, other_B_url, A_wc_dir) - svntest.actions.run_and_verify_svn(None, None, [], + svntest.actions.run_and_verify_svn(None, [], 'relocate', A_url, other_A_url, A_wc_dir) @@ -208,21 +206,16 @@ def relocate_and_propset(sbox): # Create virgin repos and working copy svntest.main.safe_rmtree(sbox.repo_dir, 1) svntest.main.create_repos(sbox.repo_dir) + svntest.actions.guarantee_greek_repository( + sbox.repo_dir, svntest.main.options.server_minor_version) wc_dir = sbox.wc_dir repo_dir = sbox.repo_dir repo_url = sbox.repo_url - # import the greek tree - svntest.main.greek_state.write_to_disk(svntest.main.greek_dump_dir) - exit_code, output, errput = svntest.main.run_svn( - None, 'import', '-m', 'Log message for revision 1.', - svntest.main.greek_dump_dir, sbox.repo_url) - # checkout svntest.main.safe_rmtree(wc_dir, 1) - svntest.actions.run_and_verify_svn(None, - None, [], + svntest.actions.run_and_verify_svn(None, [], 'checkout', repo_url, wc_dir) @@ -230,7 +223,7 @@ def relocate_and_propset(sbox): other_repo_dir, other_repo_url = sbox.add_repo_path('other') svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0) svntest.main.safe_rmtree(repo_dir, 1) - svntest.actions.run_and_verify_svn(None, None, [], 'relocate', + svntest.actions.run_and_verify_svn(None, [], 'relocate', repo_url, other_repo_url, wc_dir) # Remove gamma from the working copy. @@ -250,8 +243,7 @@ def relocate_and_propset(sbox): # Commit the deletion of gamma and verify. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, wc_dir) + expected_status) # Now gamma should be marked as `deleted' under the hood, at # revision 2. Meanwhile, A/D is still lagging at revision 1. @@ -263,8 +255,7 @@ def relocate_and_propset(sbox): svntest.actions.run_and_verify_commit(wc_dir, None, None, - "[Oo]ut.of.date", - wc_dir) + ".*[Oo]ut of date.*") #---------------------------------------------------------------------- @@ -273,24 +264,19 @@ def single_file_relocate(sbox): # Create virgin repos and working copy svntest.main.safe_rmtree(sbox.repo_dir, 1) - svntest.main.create_repos(sbox.repo_dir) + svntest.actions.guarantee_greek_repository( + sbox.repo_dir, svntest.main.options.server_minor_version) wc_dir = sbox.wc_dir iota_path = os.path.join(sbox.wc_dir, 'iota') repo_dir = sbox.repo_dir repo_url = sbox.repo_url iota_url = repo_url + '/iota' - - # import the greek tree - svntest.main.greek_state.write_to_disk(svntest.main.greek_dump_dir) - exit_code, output, errput = svntest.main.run_svn( - None, 'import', '-m', 'Log message for revision 1.', - svntest.main.greek_dump_dir, sbox.repo_url) + greek_dump_dir = sbox.add_wc_path('greek-dump') # checkout svntest.main.safe_rmtree(wc_dir, 1) - svntest.actions.run_and_verify_svn(None, - None, [], + svntest.actions.run_and_verify_svn(None, [], 'checkout', repo_url, wc_dir) @@ -299,7 +285,7 @@ def single_file_relocate(sbox): other_iota_url = other_repo_url + '/iota' svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 0) svntest.main.safe_rmtree(repo_dir, 1) - svntest.actions.run_and_verify_svn(None, None, + svntest.actions.run_and_verify_svn(None, ".*Cannot relocate.*", 'relocate', iota_url, other_iota_url, iota_path) @@ -322,7 +308,7 @@ def relocate_with_switched_children(sbox): svntest.main.safe_rmtree(repo_dir, 1) # Do the switch and check the results in three ways. - svntest.actions.run_and_verify_svn(None, None, [], 'relocate', + svntest.actions.run_and_verify_svn(None, [], 'relocate', repo_url, other_repo_url, wc_dir) # Attempt to commit changes and examine results @@ -340,8 +326,7 @@ def relocate_with_switched_children(sbox): # This won't actually do a commit, because nothing should be modified. svntest.actions.run_and_verify_commit(wc_dir, - expected_output, expected_status, - None, wc_dir) + expected_output, expected_status) # Check the URLs of various nodes. info_output = { @@ -369,7 +354,7 @@ def relocate_with_relative_externals(sbox): # Add a relative external. change_external(os.path.join(wc_dir, 'A', 'B'), "^/A/D/G G-ext\n../D/H H-ext", commit=True) - svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir) + svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir) # Move our repository to another location. repo_dir = sbox.repo_dir @@ -379,7 +364,7 @@ def relocate_with_relative_externals(sbox): svntest.main.safe_rmtree(repo_dir, 1) # Now relocate our working copy. - svntest.actions.run_and_verify_svn(None, None, [], 'relocate', + svntest.actions.run_and_verify_svn(None, [], 'relocate', repo_url, other_repo_url, wc_dir) # Check the URLs of the externals -- were they updated to point to the |