Index: subversion/tests/cmdline/merge_tests.py =================================================================== --- subversion/tests/cmdline/merge_tests.py (revision 25843) +++ subversion/tests/cmdline/merge_tests.py (working copy) @@ -1122,15 +1122,9 @@ svntest.actions.run_and_verify_status(apply_path, expected_status) #---------------------------------------------------------------------- -def merge_one_file_helper(sbox, arg_flav): - sbox.build() - wc_dir = sbox.wc_dir - - rho_rel_path = os.path.join('A', 'D', 'G', 'rho') - rho_path = os.path.join(wc_dir, rho_rel_path) - G_path = os.path.join(wc_dir, 'A', 'D', 'G') - rho_url = svntest.main.current_repo_url + '/A/D/G/rho' - +def append_to_rho_and_backdate_wc(wc_dir, rho_rel_path, rho_path): + """Append text to A/D/G/rho in r2, then backdate WC to r1. Return the + expected status.""" # Change rho for revision 2 svntest.main.file_append(rho_path, 'A new line in rho.\n') @@ -1138,17 +1132,30 @@ expected_status = svntest.actions.get_virginal_state(wc_dir, 2) expected_status.tweak(wc_rev=1) expected_status.tweak('A/D/G/rho', wc_rev=2) - svntest.actions.run_and_verify_commit (wc_dir, - expected_output, - expected_status, - None, - None, None, None, None, - wc_dir) + svntest.actions.run_and_verify_commit(wc_dir, + expected_output, + expected_status, + None, + None, None, None, None, + wc_dir) # Backdate rho to revision 1, so we can merge in the rev 2 changes. svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r', '1', rho_path) + return expected_status +def merge_one_file_helper(sbox, arg_flav): + sbox.build() + wc_dir = sbox.wc_dir + + rho_rel_path = os.path.join('A', 'D', 'G', 'rho') + rho_path = os.path.join(wc_dir, rho_rel_path) + G_path = os.path.join(wc_dir, 'A', 'D', 'G') + rho_url = svntest.main.current_repo_url + '/A/D/G/rho' + + expected_status = append_to_rho_and_backdate_wc(wc_dir, rho_rel_path, + rho_path) + # Try one merge with an explicit target; it should succeed. # ### Yes, it would be nice to use run_and_verify_merge(), but it # appears to be impossible to get the expected_foo trees working @@ -1218,6 +1225,26 @@ merge_one_file_helper(sbox, 'c') #---------------------------------------------------------------------- +def merge_wcpath_shortcut(sbox): + "use WC path as both source URL and target WC path" + sbox.build() + + rho_rel_path = os.path.join('A', 'D', 'G', 'rho') + rho_path = os.path.join(sbox.wc_dir, rho_rel_path) + expected_status = append_to_rho_and_backdate_wc(sbox.wc_dir, rho_rel_path, + rho_path) + + saved_cwd = os.getcwd() + try: + print sbox.wc_dir + os.chdir(sbox.wc_dir) + svntest.actions.run_and_verify_svn(None, ['U ' + rho_rel_path + '\n'], + [], 'merge', '-c', '2', rho_rel_path) + finally: + os.chdir(saved_cwd) + + +#---------------------------------------------------------------------- # This is a regression for the enhancement added in issue #785. def merge_with_implicit_target_helper(sbox, arg_flav): @@ -3817,6 +3844,7 @@ three_way_merge_add_of_existing_binary_file, merge_one_file_using_r, merge_one_file_using_c, + merge_wcpath_shortcut, merge_in_new_file_and_diff, merge_skips_obstructions, merge_into_missing,