# Merge with relative urls def merge_with_relative_urls(sbox): "merge with relative urls" sbox.build() wc_dir = sbox.wc_dir repo_url = sbox.repo_url # Rev 2 copy B to B2 B_path = os.path.join(wc_dir, 'A', 'B') lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda') B2_path = os.path.join(wc_dir, 'A', 'B2') B_url = repo_url + '/A/B' svntest.actions.run_and_verify_svn(None, None, [], 'copy', B_path, B2_path) expected_output = wc.State(wc_dir, { 'A/B2' : Item(verb='Adding'), }) expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.add({ 'A/B2' : Item(status=' ', wc_rev=2), 'A/B2/E' : Item(status=' ', wc_rev=2), 'A/B2/E/alpha' : Item(status=' ', wc_rev=2), 'A/B2/E/beta' : Item(status=' ', wc_rev=2), 'A/B2/F' : Item(status=' ', wc_rev=2), 'A/B2/lambda' : Item(status=' ', 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_svn(None, None, [], 'up', wc_dir) # Rev 3 modify A/B/lambda lambda_text = fill_file_with_lines(lambda_path, 2) svntest.main.file_append(lambda_path, lambda_text) expected_output = wc.State(wc_dir, { 'A/B/lambda' : Item(verb='Sending'), }) expected_status = svntest.actions.get_virginal_state(wc_dir, 2) expected_status.add({ 'A/B/lambda' : Item(status=' ', wc_rev=3), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, None, None, None, None, None, wc_dir) svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) # Now do the merge with relative url expected_output = wc.State(wc_dir, { 'A/B2/lambda' : Item(status='U ', wc_rev=3), }) expected_disk = svntest.main.greek_state.copy() expected_disk.tweak('A/B2/lambda', contents=expected_disk.desc['A/B2/lambda'].contents + lambda_text) expected_status = svntest.actions.get_virginal_state(wc_dir, 3) expected_status.add({ 'A/B2/lambda' : Item(status='M ', wc_rev=3), }) expected_skip = wc.State('', { }) #saved_cwd = os.getcwd() #os.chdir(B2_path) svntest.actions.run_and_verify_merge(B2_path, '2', '3', '^/A/B', expected_output, expected_disk, expected_status, expected_skip, None, None, None, None, None, # no B singleton handler False, # Don't check props False) # Not a dry run #os.chdir(saved_cwd)