summaryrefslogtreecommitdiff
path: root/subversion/tests/cmdline/log_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/tests/cmdline/log_tests.py')
-rwxr-xr-xsubversion/tests/cmdline/log_tests.py493
1 files changed, 345 insertions, 148 deletions
diff --git a/subversion/tests/cmdline/log_tests.py b/subversion/tests/cmdline/log_tests.py
index ffcdace..bdb749c 100755
--- a/subversion/tests/cmdline/log_tests.py
+++ b/subversion/tests/cmdline/log_tests.py
@@ -33,8 +33,8 @@ from svntest import wc
from svntest.main import server_has_mergeinfo
from svntest.main import SVN_PROP_MERGEINFO
-from merge_tests import set_up_branch
-from diff_tests import make_diff_header, make_no_diff_deleted_header
+from svntest.mergetrees import set_up_branch
+from svntest.verify import make_diff_header, make_no_diff_deleted_header
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -227,12 +227,7 @@ def merge_history_repos(sbox):
branch_c = os.path.join('branches', 'c')
# Create an empty repository - r0
- svntest.main.safe_rmtree(sbox.repo_dir, 1)
- svntest.main.safe_rmtree(sbox.wc_dir, 1)
- svntest.main.create_repos(sbox.repo_dir)
-
- svntest.actions.run_and_verify_svn(None, None, [], "co", sbox.repo_url,
- sbox.wc_dir)
+ sbox.build(empty=True)
was_cwd = os.getcwd()
os.chdir(sbox.wc_dir)
@@ -407,7 +402,6 @@ def merge_history_repos(sbox):
# Restore working directory
os.chdir(was_cwd)
-
# For errors seen while parsing log data.
class SVNLogParseError(Exception):
pass
@@ -718,6 +712,13 @@ def compare_diff_output(expected_diffs, output):
if diffs.issubset(expected_diffs) and diffs.issuperset(expected_diffs):
return
+ print("=============== DIFFS NOT EQUAL ===================")
+ print("Expected")
+ for line in expected_diffs:
+ print(line)
+ print("Actual:")
+ for line in output:
+ print(line)
raise svntest.Failure("Diffs not equal")
@@ -733,7 +734,7 @@ def plain_log(sbox):
os.chdir(sbox.wc_dir)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log')
log_chain = parse_log_output(output)
@@ -745,10 +746,9 @@ def log_with_empty_repos(sbox):
"'svn log' on an empty repository"
# Create virgin repos
- svntest.main.safe_rmtree(sbox.repo_dir, 1)
- svntest.main.create_repos(sbox.repo_dir)
+ sbox.build(create_wc=False, empty=True)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'log',
sbox.repo_url)
@@ -768,13 +768,13 @@ def log_where_nothing_changed(sbox):
rho_path = os.path.join(sbox.wc_dir, 'A', 'D', 'G', 'rho')
svntest.main.file_append(rho_path, "some new material in rho")
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'ci', '-m',
'log msg', rho_path)
# Now run 'svn log -r2' on a directory unaffected by revision 2.
H_path = os.path.join(sbox.wc_dir, 'A', 'D', 'H')
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'log', '-r', '2', H_path)
@@ -785,7 +785,7 @@ def log_to_revision_zero(sbox):
# This used to segfault the server.
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'log', '-v',
'-r', '1:0', sbox.wc_dir)
@@ -798,7 +798,7 @@ def log_with_path_args(sbox):
os.chdir(sbox.wc_dir)
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [],
+ None, [],
'log', sbox.repo_url, 'A/D/G', 'A/D/H')
log_chain = parse_log_output(output)
@@ -827,7 +827,7 @@ def log_wc_with_peg_revision(sbox):
"'svn log wc_target@N'"
guarantee_repos_and_wc(sbox)
my_path = os.path.join(sbox.wc_dir, "A", "B", "E", "beta") + "@8"
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', my_path)
check_log_chain(parse_log_output(output), [1])
@@ -839,7 +839,7 @@ def url_missing_in_head(sbox):
my_url = sbox.repo_url + "/A/B/E/alpha" + "@8"
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', my_url)
check_log_chain(parse_log_output(output), [3, 1])
@@ -870,38 +870,38 @@ def log_through_copyfrom_history(sbox):
svntest.main.file_write(msg_file, msg2)
svntest.main.file_append(mu_path, "2")
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'ci', wc_dir,
'-F', msg_file)
svntest.main.file_append(mu2_path, "this is mu2")
- svntest.actions.run_and_verify_svn(None, None, [], 'add', mu2_path)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [], 'add', mu2_path)
+ svntest.actions.run_and_verify_svn(None, [],
'ci', wc_dir,
'-m', "Log message for revision 3")
- svntest.actions.run_and_verify_svn(None, None, [], 'rm', mu2_path)
+ svntest.actions.run_and_verify_svn(None, [], 'rm', mu2_path)
svntest.main.file_write(msg_file, msg4)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'ci', wc_dir,
'-F', msg_file)
svntest.main.file_append(mu_path, "5")
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'ci', wc_dir,
'-m', "Log message for revision 5")
svntest.main.file_write(msg_file, msg6)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'cp', '-r', '5', mu_URL, mu2_URL,
'-F', msg_file)
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'up', wc_dir)
# The full log for mu2 is relatively unsurprising
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', mu2_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [6, 5, 2, 1])
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', mu2_URL)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [6, 5, 2, 1])
@@ -909,25 +909,25 @@ def log_through_copyfrom_history(sbox):
# First "oddity", the full log for mu2 doesn't include r3, but the -r3
# log works!
peg_mu2_path = mu2_path + "@3"
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-r', '3',
peg_mu2_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [3])
peg_mu2_URL = mu2_URL + "@3"
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-r', '3',
peg_mu2_URL)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [3])
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-r', '2',
mu2_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [2])
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-r', '2',
mu2_URL)
log_chain = parse_log_output(output)
@@ -980,7 +980,7 @@ PROPS-END
# run log
exit_code, output, errput = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', URL)
+ None, [], 'log', URL)
# Verify the output contains either the expected fuzzy escape
# sequence, or the literal control char.
@@ -1010,7 +1010,7 @@ def log_xml_empty_date(sbox):
# Ensure that we get a date before we delete the property.
exit_code, output, errput = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--xml', '-r1', sbox.wc_dir)
+ None, [], 'log', '--xml', '-r1', sbox.wc_dir)
matched = 0
for line in output:
@@ -1020,12 +1020,12 @@ def log_xml_empty_date(sbox):
raise svntest.Failure("log contains no date element")
# Set the svn:date revprop to the empty string on revision 1.
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'pdel', '--revprop', '-r1', 'svn:date',
sbox.wc_dir)
exit_code, output, errput = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--xml', '-r1', sbox.wc_dir)
+ None, [], 'log', '--xml', '-r1', sbox.wc_dir)
for line in output:
if date_re.search(line):
@@ -1036,14 +1036,14 @@ def log_limit(sbox):
"svn log --limit"
guarantee_repos_and_wc(sbox)
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log',
'--limit', '2',
sbox.repo_url)
log_chain = parse_log_output(out)
check_log_chain(log_chain, [9, 8])
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log',
'--limit', '2',
sbox.repo_url,
@@ -1052,7 +1052,7 @@ def log_limit(sbox):
check_log_chain(log_chain, [9, 6])
exit_code, out, err = svntest.actions.run_and_verify_svn(
- None, None, [],
+ None, [],
'log', '--limit', '2', '--revision', '2:HEAD', sbox.repo_url, 'A/B')
log_chain = parse_log_output(out)
@@ -1060,7 +1060,7 @@ def log_limit(sbox):
# Use -l instead of --limit to test both option forms.
exit_code, out, err = svntest.actions.run_and_verify_svn(
- None, None, [],
+ None, [],
'log', '-l', '2', '--revision', '1', sbox.repo_url, 'A/B')
log_chain = parse_log_output(out)
@@ -1069,11 +1069,11 @@ def log_limit(sbox):
must_be_positive = ".*Argument to --limit must be positive.*"
# error expected when limit <= 0
- svntest.actions.run_and_verify_svn(None, None, must_be_positive,
+ svntest.actions.run_and_verify_svn(None, must_be_positive,
'log', '--limit', '0', '--revision', '1',
sbox.repo_url, 'A/B')
- svntest.actions.run_and_verify_svn(None, None, must_be_positive,
+ svntest.actions.run_and_verify_svn(None, must_be_positive,
'log', '--limit', '-1', '--revision', '1',
sbox.repo_url, 'A/B')
@@ -1083,16 +1083,16 @@ def log_base_peg(sbox):
target = os.path.join(sbox.wc_dir, 'A', 'B', 'E', 'beta') + '@BASE'
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log', target)
log_chain = parse_log_output(out)
check_log_chain(log_chain, [9, 1])
- svntest.actions.run_and_verify_svn(None, None, [], 'update', '-r', '1',
+ svntest.actions.run_and_verify_svn(None, [], 'update', '-r', '1',
sbox.wc_dir)
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log', target)
log_chain = parse_log_output(out)
@@ -1103,7 +1103,7 @@ def log_verbose(sbox):
"run log with verbose output"
guarantee_repos_and_wc(sbox)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-v',
sbox.wc_dir)
@@ -1262,7 +1262,7 @@ def merge_sensitive_log_single_revision(sbox):
}
os.chdir(TRUNK_path)
# First try a single rev using -rN
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'-r14')
@@ -1270,7 +1270,7 @@ def merge_sensitive_log_single_revision(sbox):
log_chain = parse_log_output(output)
check_merge_results(log_chain, expected_merges)
# Then try a single rev using --limit 1
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'--limit', '1',
'-r14:1')
@@ -1285,13 +1285,13 @@ def merge_sensitive_log_single_revision(sbox):
11 : [12],
}
# First try a single rev using -rN
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'-r12',
BRANCH_B_path)
log_chain = parse_log_output(output)
check_merge_results(log_chain, expected_merges)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'--limit', '1',
'-r12:1',
@@ -1311,7 +1311,7 @@ def merge_sensitive_log_branching_revision(sbox):
BRANCH_B_path = os.path.join(wc_dir, "branches", "b")
# Run log on a copying revision
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'-r10',
BRANCH_B_path)
@@ -1333,7 +1333,7 @@ def merge_sensitive_log_non_branching_revision(sbox):
TRUNK_path = os.path.join(sbox.wc_dir, "trunk")
# Run log on a non-copying revision that adds mergeinfo
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'-r6',
TRUNK_path)
@@ -1357,7 +1357,7 @@ def merge_sensitive_log_added_path(sbox):
XI_path = os.path.join(sbox.wc_dir, "trunk", "A", "xi")
# Run log on a non-copying revision that adds mergeinfo
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
XI_path)
@@ -1387,7 +1387,7 @@ def log_single_change(sbox):
guarantee_repos_and_wc(sbox)
repo_url = sbox.repo_url
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-c',
4, repo_url)
log_chain = parse_log_output(output)
@@ -1399,7 +1399,7 @@ def log_changes_range(sbox):
guarantee_repos_and_wc(sbox)
repo_url = sbox.repo_url
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-c',
'2-5', repo_url)
@@ -1412,7 +1412,7 @@ def log_changes_list(sbox):
guarantee_repos_and_wc(sbox)
repo_url = sbox.repo_url
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-c',
'2,5,7',
repo_url)
@@ -1426,7 +1426,7 @@ def log_changes_complex(sbox):
guarantee_repos_and_wc(sbox)
repo_url = sbox.repo_url
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-c',
'2,5-3,-8,6-7', repo_url)
@@ -1474,7 +1474,7 @@ def retrieve_revprops(sbox):
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
- None,
+ [],
'-m', msg2,
omega_path)
@@ -1482,10 +1482,10 @@ def retrieve_revprops(sbox):
# Set custom property on r1 and r2.
svntest.actions.run_and_verify_svn(
- None, None, [], # message, expected_stdout, expected_stderr
+ None, [], # message, expected_stdout, expected_stderr
'ps', '--revprop', '-r1', custom_name, custom_value, sbox.repo_url)
svntest.actions.run_and_verify_svn(
- None, None, [], # message, expected_stdout, expected_stderr
+ None, [], # message, expected_stdout, expected_stderr
'ps', '--revprop', '-r2', custom_name, custom_value, sbox.repo_url)
# Can't set revprops with log.
@@ -1580,8 +1580,8 @@ def merge_sensitive_log_target_with_bogus_mergeinfo(sbox):
svntest.main.run_svn(None, 'ci', '-m', 'setting bogus mergeinfo', wc_path)
# The tests: Check that 'svn log -g' doesn't error on these.
- svntest.actions.run_and_verify_svn(None, None, [], 'log', '-g', C_path)
- svntest.actions.run_and_verify_svn(None, None, [], 'log', '-g', D_path)
+ svntest.actions.run_and_verify_svn(None, [], 'log', '-g', C_path)
+ svntest.actions.run_and_verify_svn(None, [], 'log', '-g', D_path)
@SkipUnless(server_has_mergeinfo)
@Issue(3235)
@@ -1646,8 +1646,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
expected_disk,
expected_status,
expected_skip,
- None, None, None, None,
- None, 1)
+ check_props=True)
# Commit the merge.
expected_output = svntest.wc.State(wc_dir, {
@@ -1661,8 +1660,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
'A_COPY/D/H/omega',
'A_COPY/D/H/psi',
wc_rev=7)
- svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
- None, wc_dir)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
wc_disk.tweak("A_COPY/D",
props={SVN_PROP_MERGEINFO : '/A/D:2-6'})
wc_disk.tweak("A_COPY/D/G/rho", "A_COPY/D/H/omega", "A_COPY/D/H/psi",
@@ -1671,8 +1669,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
# Reverse merge r3 from 'A/D/H' to 'A_COPY/D/H' and commit as r8.
# First update the wc so mergeinfo inheritance can occur. This is
# necessary so A_COPY/D/H 'knows' that r3 has been merged into it.
- svntest.actions.run_and_verify_svn(None,
- exp_noop_up_out(7), [],
+ svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
'up', wc_dir)
wc_status.tweak(wc_rev=7)
expected_output = wc.State(H_COPY_path, {
@@ -1703,7 +1700,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
expected_elision_output,
expected_disk,
expected_status, expected_skip,
- None, None, None, None, None, 1)
+ check_props=True)
# Commit the merge.
expected_output = svntest.wc.State(wc_dir, {
@@ -1713,8 +1710,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
wc_status.tweak('A_COPY/D/H',
'A_COPY/D/H/psi',
wc_rev=8)
- svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
- None, wc_dir)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
wc_disk.tweak("A_COPY/D/H",
props={SVN_PROP_MERGEINFO : '/A/D:2,4-6'})
wc_disk.tweak("A_COPY/D/G/rho", "A_COPY/D/H/omega", "A_COPY/D/H/psi",
@@ -1735,7 +1731,7 @@ def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
8 : []}
expected_reverse_merges = {
3 : [8]}
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None,
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None,
[],
'log', '-g',
'-r8',
@@ -1788,7 +1784,7 @@ def merge_sensitive_log_propmod_merge_inheriting_path(sbox):
3 : [7],
}
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-g', '-r7', log_target)
+ None, [], 'log', '-g', '-r7', log_target)
log_chain = parse_log_output(output)
check_merge_results(log_chain, expected_merges)
run_log_g_r7(wc_dir)
@@ -1798,7 +1794,7 @@ def merge_sensitive_log_propmod_merge_inheriting_path(sbox):
def run_log_g_r8(log_target):
expected_merges = { 8 : [] }
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-g', '-r8', log_target)
+ None, [], 'log', '-g', '-r8', log_target)
log_chain = parse_log_output(output)
check_merge_results(log_chain, expected_merges)
run_log_g_r8(wc_dir)
@@ -1820,14 +1816,14 @@ def log_of_local_copy(sbox):
# Get the logs for a directory and a file.
exit_code, C_log_out, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-v', C_path)
+ None, [], 'log', '-v', C_path)
exit_code, psi_log_out, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-v', psi_path)
+ None, [], 'log', '-v', psi_path)
# Move that directory and file.
- svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ svntest.actions.run_and_verify_svn(None, [], 'mv',
C_path, C_moved_path)
- svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ svntest.actions.run_and_verify_svn(None, [], 'mv',
psi_path, psi_moved_path)
# Get the logs for the move destinations.
@@ -1843,9 +1839,9 @@ def log_of_local_copy(sbox):
# svn: File not found: revision 9, path '/A/C_MOVED'
#
exit_code, C_moved_log_out, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-v', C_moved_path)
+ None, [], 'log', '-v', C_moved_path)
exit_code, psi_moved_log_out, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-v', psi_moved_path)
+ None, [], 'log', '-v', psi_moved_path)
# The logs of the move source and destinations should be the same.
if C_log_out != C_moved_log_out:
@@ -1875,20 +1871,18 @@ def merge_sensitive_log_reverse_merges(sbox):
# Merge -c3,5 from A to A_COPY, commit as r7
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', '-c3,5', A_path, A_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Merge -c3,5 from A to A_COPY',
- wc_dir)
+ sbox.simple_commit(message='Merge -c3,5 from A to A_COPY')
# Merge -c-3,-5,4,6 from A to A_COPY, commit as r8
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', '-c-3,4,-5,6', A_path, A_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Merge -c-3,-5,4,6 from A to A_COPY',
- wc_dir)
+ sbox.simple_commit(message='Merge -c-3,-5,4,6 from A to A_COPY')
# Update so
svntest.main.run_svn(None, 'up', wc_dir)
# Run log -g on path with explicit mergeinfo (A_COPY).
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g', '-r8',
A_COPY_path)
log_chain = parse_log_output(out)
@@ -1904,7 +1898,7 @@ def merge_sensitive_log_reverse_merges(sbox):
check_merge_results(log_chain, expected_merges, expected_reverse_merges)
# Run log -g on path with inherited mergeinfo (A_COPY/D).
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g', '-r8',
D_COPY_path)
log_chain = parse_log_output(out)
@@ -1938,58 +1932,55 @@ def merge_sensitive_log_ignores_cyclic_merges(sbox):
# Make an edit on the "branch" to A_COPY/mu, commit as r7.
svntest.main.file_write(mu_COPY_path, "Branch edit.\n")
- svntest.main.run_svn(None, 'ci', '-m', 'Branch edit', wc_dir)
+ sbox.simple_commit(message='Branch edit')
# Make an edit on both the "trunk" and the "branch", commit as r8.
svntest.main.file_write(chi_path, "Trunk edit.\n")
svntest.main.file_write(tau_COPY_path, "Branch edit.\n")
- svntest.main.run_svn(None, 'ci', '-m', 'Branch and trunk edits in one rev',
- wc_dir)
+ sbox.simple_commit(message='Branch and trunk edits in one rev')
# Sync merge A to A_COPY, commit as r9
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Sync merge A to A_COPY', wc_dir)
+ sbox.simple_commit(message='Sync merge A to A_COPY')
# Reintegrate A_COPY to A, commit as r10
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', '--reintegrate',
sbox.repo_url + '/A_COPY', A_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Reintegrate A_COPY to A', wc_dir)
+ sbox.simple_commit(message='Reintegrate A_COPY to A')
# Do a --record-only merge of r10 from A to A_COPY, commit as r11.
# This will allow us to continue using the branch without deleting it.
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m',
- '--record-only merge r10 from A to A_COPY', wc_dir)
+ sbox.simple_commit(message='--record-only merge r10 from A to A_COPY')
# Make an edit on the "branch"; add A_COPY/C and A_COPY/C/Z/nu,
# commit as r12.
svntest.main.run_svn(None, 'mkdir', Z_COPY_path)
svntest.main.file_write(nu_COPY_path, "A new branch file.\n")
svntest.main.run_svn(None, 'add', nu_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Branch edit: Add a subtree', wc_dir)
+ sbox.simple_commit(message='Branch edit: Add a subtree')
# Make an edit on the "trunk"; add A/C/X and A/C/X/kappa,
# commit as r13.
svntest.main.run_svn(None, 'mkdir', X_path)
svntest.main.file_write(kappa_path, "A new trunk file.\n")
svntest.main.run_svn(None, 'add', kappa_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Trunk edit: Add a subtree', wc_dir)
+ sbox.simple_commit(message='Trunk edit: Add a subtree')
svntest.main.run_svn(None, 'up', wc_dir)
# Sync merge A to A_COPY, commit as r14
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Sync merge A to A_COPY', wc_dir)
+ sbox.simple_commit(message='Sync merge A to A_COPY')
# Reintegrate A_COPY to A, commit as r15
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', '--reintegrate',
sbox.repo_url + '/A_COPY', A_path)
- svntest.main.run_svn(None, 'ci', '-m', '2nd reintegrate of A_COPY to A',
- wc_dir)
+ sbox.simple_commit(message='2nd reintegrate of A_COPY to A')
# Run 'svn log -g A'. We expect to see r13, r10, r6, r5, r4, and r3 only
# once, as part of A's own history, not as merged in from A_COPY.
@@ -2011,7 +2002,7 @@ def merge_sensitive_log_ignores_cyclic_merges(sbox):
1 : [],
}
svntest.main.run_svn(None, 'up', wc_dir)
- exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
A_path)
log_chain = parse_log_output(out)
@@ -2028,21 +2019,21 @@ def log_with_unrelated_peg_and_operative_revs(sbox):
# log for /A/D/G/rho, deleted in revision 5, recreated in revision 8
expected_error = ".*(File|path) not found.*"
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', '6:7', target)
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', '7:6', target)
expected_error = ".*Unable to find repository location for.*"
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', '2:9', target)
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', '9:2', target)
expected_error = ".*Unable to find repository location for.*"
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', '2:HEAD', target)
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-r', 'HEAD:2', target)
#----------------------------------------------------------------------
@@ -2057,24 +2048,25 @@ def log_on_nonexistent_path_and_valid_rev(sbox):
bad_path_real_rev = sbox.repo_url + '/Z@1'
bad_path_default_rev = sbox.repo_url + '/Z'
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'log', '-q', real_path_real_rev)
expected_error = ".*No such revision 99*"
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-q', real_path_bad_rev)
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-q', bad_url_bad_rev)
expected_error = ".*not found.*"
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-q', bad_path_real_rev)
- svntest.actions.run_and_verify_svn(None, None, expected_error,
+ svntest.actions.run_and_verify_svn(None, expected_error,
'log', '-q', bad_path_default_rev)
#----------------------------------------------------------------------
# Test for issue #4022 'svn log -g interprets change in inherited mergeinfo
# due to move as a merge'.
+@SkipUnless(server_has_mergeinfo)
@Issue(4022)
def merge_sensitive_log_copied_path_inherited_mergeinfo(sbox):
"log -g on copied path with inherited mergeinfo"
@@ -2090,17 +2082,17 @@ def merge_sensitive_log_copied_path_inherited_mergeinfo(sbox):
# r3 - Modify a file (A_COPY/D/gamma) on the branch
svntest.main.file_write(gamma_COPY_path, "Branch edit.\n")
- svntest.main.run_svn(None, 'ci', '-m', 'Branch edit', wc_dir)
+ sbox.simple_commit(message='Branch edit')
# r4 - Reintegrate A_COPY to A
svntest.main.run_svn(None, 'up', wc_dir)
svntest.main.run_svn(None, 'merge', '--reintegrate',
sbox.repo_url + '/A_COPY', A_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Reintegrate A_COPY to A', wc_dir)
+ sbox.simple_commit(message='Reintegrate A_COPY to A')
# r5 - Move file modified by reintegrate (A/D/gamma to A/C/gamma).
svntest.main.run_svn(None, 'move', old_gamma_path, new_gamma_path)
- svntest.main.run_svn(None, 'ci', '-m', 'Move file', wc_dir)
+ sbox.simple_commit(message='Move file')
# 'svn log -g --stop-on-copy ^/A/C/gamma' hould return *only* r5
# Previously this test failed because the change in gamma's inherited
@@ -2132,7 +2124,7 @@ def merge_sensitive_log_copied_path_inherited_mergeinfo(sbox):
expected_merges = {5 : []}
svntest.main.run_svn(None, 'up', wc_dir)
exit_code, out, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-g', '--stop-on-copy',
+ None, [], 'log', '-g', '--stop-on-copy',
sbox.repo_url + '/A/C/gamma')
log_chain = parse_log_output(out)
check_merge_results(log_chain, expected_merges)
@@ -2146,7 +2138,7 @@ def log_diff(sbox):
was_cwd = os.getcwd()
os.chdir(sbox.wc_dir)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff')
os.chdir(was_cwd)
@@ -2164,7 +2156,7 @@ def log_diff(sbox):
sbox.simple_commit()
os.chdir(sbox.wc_dir)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff',
'-r10:8', 'A2')
os.chdir(was_cwd)
@@ -2177,7 +2169,7 @@ def log_diff(sbox):
"\ No newline at end of file\n",
]
]
- r8diff = [ make_diff_header('A2/D/G/rho', 'revision 0', 'revision 8')
+ r8diff = [ make_diff_header('A2/D/G/rho', 'nonexistent', 'revision 8')
+ [ "@@ -0,0 +1 @@\n",
"+88\n",
"\ No newline at end of file\n",
@@ -2189,6 +2181,7 @@ def log_diff(sbox):
compare_diff_output(r9diff, log_chain[1]['diff_lines'])
compare_diff_output(r8diff, log_chain[2]['diff_lines'])
+@Skip(svntest.main.is_fs_type_fsx)
def log_xml_old(sbox):
"log --xml shows kind for old style repository"
@@ -2224,7 +2217,7 @@ def log_diff_moved(sbox):
mu_at_1 = sbox.repo_url + '/A/mu@1'
mu3_at_3 = sbox.repo_url + '/A/mu3@3'
- r1diff = [make_diff_header('mu', 'revision 0', 'revision 1')
+ r1diff = [make_diff_header('mu', 'nonexistent', 'revision 1')
+ ["@@ -0,0 +1 @@\n",
"+This is the file 'mu'.\n"]]
@@ -2244,7 +2237,7 @@ def log_diff_moved(sbox):
" now mu2\n",
"+now mu3\n"]]
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff',
mu_at_1)
log_chain = parse_log_output(output, with_diffs=True)
@@ -2252,7 +2245,7 @@ def log_diff_moved(sbox):
raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
compare_diff_output(r1diff, log_chain[0]['diff_lines'])
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff',
'-r3', mu3_at_3)
log_chain = parse_log_output(output, with_diffs=True)
@@ -2260,7 +2253,7 @@ def log_diff_moved(sbox):
raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
compare_diff_output(r3diff, log_chain[0]['diff_lines'])
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff',
'-r3:2', mu3_at_3)
log_chain = parse_log_output(output, with_diffs=True)
@@ -2269,8 +2262,7 @@ def log_diff_moved(sbox):
compare_diff_output(r3diff, log_chain[0]['diff_lines'])
compare_diff_output(r2diff, log_chain[1]['diff_lines'])
- # XFAIL mu3 not found at revisions 0 and 1
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '--diff',
mu3_at_3)
log_chain = parse_log_output(output, with_diffs=True)
@@ -2290,7 +2282,7 @@ def log_search(sbox):
os.chdir(sbox.wc_dir)
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--search',
+ None, [], 'log', '--search',
'for revision [367]')
log_chain = parse_log_output(output)
@@ -2298,7 +2290,7 @@ def log_search(sbox):
# search is case-sensitive
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--search',
+ None, [], 'log', '--search',
'FOR REVISION [367]')
log_chain = parse_log_output(output)
@@ -2306,7 +2298,7 @@ def log_search(sbox):
# multi-pattern search
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log',
+ None, [], 'log',
'--search', 'for revision 3',
'--search', 'for revision 6',
'--search', 'for revision 7')
@@ -2316,7 +2308,7 @@ def log_search(sbox):
# combined pattern search
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--verbose',
+ None, [], 'log', '--verbose',
'--search', 'for revision 8',
'--search-and', 'test the code',
'--search', 'for revision 7',
@@ -2329,7 +2321,7 @@ def log_search(sbox):
check_log_chain(log_chain, [8, 6])
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--verbose',
+ None, [], 'log', '--verbose',
'--search', 'for revision 8',
'--search-and', 'this won\'t match ',
'--search', 'for revision 7',
@@ -2351,7 +2343,7 @@ def merge_sensitive_log_with_search(sbox):
# Run log -g on a non-copying revision that adds mergeinfo,
# and perform a search that only matches the merged revision
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
'log', '-g',
'-r6',
'--search',
@@ -2365,13 +2357,9 @@ def merge_sensitive_log_with_search(sbox):
}
check_merge_results(log_chain, expected_merges)
-#----------------------------------------------------------------------
-# Test for issue #4355 'svn_client_log5 broken with multiple revisions
-# which span a rename'.
-@Issue(4355)
-@SkipUnless(server_has_mergeinfo)
-def log_multiple_revs_spanning_rename(sbox):
- "log for multiple revs which span a rename"
+# Helper function for a few tests
+def create_renaming_history_repos(sbox):
+ "create a repository containing renames and a suitable working copy"
sbox.build()
wc_dir = sbox.wc_dir
@@ -2379,7 +2367,6 @@ def log_multiple_revs_spanning_rename(sbox):
msg_file=os.path.abspath(msg_file)
mu_path1 = os.path.join(wc_dir, 'A', 'mu')
mu_path2 = os.path.join(wc_dir, 'trunk', 'mu')
- trunk_path = os.path.join(wc_dir, 'trunk')
# r2 - Change a file.
msg=""" Log message for revision 2
@@ -2404,21 +2391,42 @@ def log_multiple_revs_spanning_rename(sbox):
svntest.main.run_svn(None, 'ci', '-F', msg_file, wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
+ # r5 - Cyclic exchange.
+ svntest.main.run_svn(None, 'up', wc_dir)
+ sbox.simple_move(os.path.join('trunk', 'D'), os.path.join('trunk', 'X'))
+ sbox.simple_move(os.path.join('trunk', 'C'), os.path.join('trunk', 'D'))
+ sbox.simple_move(os.path.join('trunk', 'X'), os.path.join('trunk', 'C'))
+ svntest.main.run_svn(None, 'ci', '-m', "Log message for revision 5",
+ wc_dir)
+
+
+#----------------------------------------------------------------------
+# Test for issue #4355 'svn_client_log5 broken with multiple revisions
+# which span a rename'.
+@Issue(4355)
+@SkipUnless(server_has_mergeinfo)
+def log_multiple_revs_spanning_rename(sbox):
+ "log for multiple revs which span a rename"
+
+ trunk_path = sbox.ospath('trunk')
+
+ create_renaming_history_repos(sbox)
+
# Check that log can handle a revision range that spans a rename.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r2:4', sbox.repo_url + '/trunk/mu')
+ None, [], 'log', '-r2:4', sbox.repo_url + '/trunk/mu')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [2,3,4])
# Check that log can handle discrete revisions that don't span a rename.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-c3,4', sbox.repo_url + '/trunk/mu')
+ None, [], 'log', '-c3,4', sbox.repo_url + '/trunk/mu')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [3,4])
# Check that log can handle discrete revisions that span a rename.
#
- # Currently this fails with:
+ # Previously this failed with:
#
# >svn log ^/trunk -c2,3,1
# ------------------------------------------------------------------------
@@ -2440,19 +2448,21 @@ def log_multiple_revs_spanning_rename(sbox):
# (apr_err=SVN_ERR_FS_NOT_FOUND)
# svn: E160013: File not found: revision 1, path '/trunk'
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-c2,3,1', sbox.repo_url + '/trunk/mu')
+ None, [], 'log', '-c2,3,1', sbox.repo_url + '/trunk/mu')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [2,3,1])
+ mu_path2 = sbox.ospath('trunk/mu')
+
# Should work with a WC target too.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-c2,3,1', mu_path2)
+ None, [], 'log', '-c2,3,1', mu_path2)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [2,3,1])
# Discreet revision *ranges* which span a rename should work too.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1', '-r4:2', sbox.repo_url + '/trunk')
+ None, [], 'log', '-r1', '-r4:2', sbox.repo_url + '/trunk')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,4,3,2])
@@ -2473,26 +2483,210 @@ def log_multiple_revs_spanning_rename(sbox):
# (apr_err=SVN_ERR_FS_NOT_FOUND)
# svn: E160013: File not found: revision 4, path '/A'
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1', '-r2:4', sbox.repo_url + '/trunk')
+ None, [], 'log', '-r1', '-r2:4', sbox.repo_url + '/trunk')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,2,3,4])
# Discrete revs with WC-only opt revs shouldn't cause any problems.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1', '-rPREV', trunk_path)
+ None, [], 'log', '-r1', '-rPREV', trunk_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,3])
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1', '-rCOMMITTED', trunk_path)
+ None, [], 'log', '-r1', '-rCOMMITTED', trunk_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,4])
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1', '-rBASE', trunk_path)
+ None, [], 'log', '-r1', '-rBASE', trunk_path)
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,4])
+@SkipUnless(server_has_mergeinfo)
+def mergeinfo_log(sbox):
+ "'mergeinfo --log' on a path with mergeinfo"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # make a branch 'A2'
+ sbox.simple_repo_copy('A', 'A2') # r2
+ # make a change in branch 'A'
+ sbox.simple_mkdir('A/newdir')
+ sbox.simple_commit(message="Log message for revision 3.") # r3
+ sbox.simple_update()
+
+ # Dummy up some mergeinfo.
+ svntest.actions.run_and_verify_svn(None, [],
+ 'ps', SVN_PROP_MERGEINFO, '/A:3',
+ sbox.ospath('A2'))
+
+ # test --log
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
+ 'mergeinfo', '--show-revs=merged',
+ '--log', sbox.repo_url + '/A',
+ sbox.ospath('A2'))
+ check_log_chain(parse_log_output(output), [3])
+
+ # test --log -v
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
+ 'mergeinfo', '--show-revs=merged',
+ '--log', '-v', sbox.repo_url + '/A',
+ sbox.ospath('A2'))
+ check_log_chain(parse_log_output(output), [3], [1])
+
+ # test --log -q
+ svntest.actions.run_and_verify_svn(None, [],
+ 'mergeinfo', '--show-revs=merged',
+ '--log', '-q', sbox.repo_url + '/A',
+ sbox.ospath('A2'))
+ # TODO: Validate the output, the check_log_chain() function assumes it
+ # gets the output of the message
+
+@SkipUnless(server_has_mergeinfo)
+@Issue(4463)
+def merge_sensitive_log_xml_reverse_merges(sbox):
+ "log -g --xml differentiates forward/reverse merges"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ wc_disk, wc_status = set_up_branch(sbox)
+
+ A_path = os.path.join(wc_dir, 'A')
+ A_COPY_path = os.path.join(wc_dir, 'A_COPY')
+ D_COPY_path = os.path.join(wc_dir, 'A_COPY', 'D')
+
+ # Merge -c3,5 from A to A_COPY, commit as r7
+ svntest.main.run_svn(None, 'up', wc_dir)
+ svntest.main.run_svn(None, 'merge', '-c3,5', A_path, A_COPY_path)
+ sbox.simple_commit(message='Merge -c3,5 from A to A_COPY')
+
+ # Merge -c-3,-5,4,6 from A to A_COPY, commit as r8
+ svntest.main.run_svn(None, 'up', wc_dir)
+ svntest.main.run_svn(None, 'merge', '-c-3,4,-5,6', A_path, A_COPY_path)
+ sbox.simple_commit(message='Merge -c-3,-5,4,6 from A to A_COPY')
+
+ # Update so
+ svntest.main.run_svn(None, 'up', wc_dir)
+
+ # Run log -g --xml on path with explicit mergeinfo (A_COPY).
+ log_attrs = [
+ {
+ u'revision': u'8',
+ },
+ {
+ u'revision': u'6',
+ u'reverse-merge': u'false',
+ },
+ {
+ u'revision': u'5',
+ u'reverse-merge': u'true',
+ },
+ {
+ u'revision': u'4',
+ u'reverse-merge': u'false',
+ },
+ {
+ u'revision': u'3',
+ u'reverse-merge': u'true',
+ }]
+ svntest.actions.run_and_verify_log_xml(expected_log_attrs=log_attrs,
+ args=['-g', '-r8', A_COPY_path])
+
+ # Run log -g --xml on path with inherited mergeinfo (A_COPY/D).
+ # r5 only affects A_COPY/B/E/beta so not listed
+ log_attrs = [
+ {
+ u'revision': u'8',
+ },
+ {
+ u'revision': u'6',
+ u'reverse-merge': u'false',
+ },
+ {
+ u'revision': u'4',
+ u'reverse-merge': u'false',
+ },
+ {
+ u'revision': u'3',
+ u'reverse-merge': u'true',
+ }]
+ 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
@@ -2539,6 +2733,9 @@ test_list = [ None,
log_search,
merge_sensitive_log_with_search,
log_multiple_revs_spanning_rename,
+ mergeinfo_log,
+ merge_sensitive_log_xml_reverse_merges,
+ log_revision_move_copy,
]
if __name__ == '__main__':