summaryrefslogtreecommitdiff
path: root/subversion/tests/cmdline/move_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/tests/cmdline/move_tests.py')
-rwxr-xr-xsubversion/tests/cmdline/move_tests.py546
1 files changed, 356 insertions, 190 deletions
diff --git a/subversion/tests/cmdline/move_tests.py b/subversion/tests/cmdline/move_tests.py
index 4495b59..b9f921c 100755
--- a/subversion/tests/cmdline/move_tests.py
+++ b/subversion/tests/cmdline/move_tests.py
@@ -152,7 +152,7 @@ def move_file_test(sbox, source, dest, move_func, test):
# update to start_rev
svntest.actions.run_and_verify_update(wc_dir, test['start_output'],
test['start_disk'], test['start_status'],
- None, None, None, None, None, False,
+ [], False,
'-r', test['start_rev'], wc_dir)
# execute the move
move_func(test['start_rev'])
@@ -162,7 +162,7 @@ def move_file_test(sbox, source, dest, move_func, test):
# properties.
svntest.actions.run_and_verify_update(wc_dir, test['up_output'],
test['up_disk'], test['up_status'],
- None, None, None, None, None, True,
+ [], True,
'-r', test['end_rev'], wc_dir)
revert_paths = None
@@ -182,8 +182,7 @@ def move_file_test(sbox, source, dest, move_func, test):
resolve['disk'] = None
if 'revert_paths' in resolve:
revert_paths = resolve['revert_paths']
- svntest.actions.run_and_verify_svn('Resolve modification to source of move',
- resolve['output'], resolve['error'],
+ svntest.actions.run_and_verify_svn(resolve['output'], resolve['error'],
'resolve', '--accept', resolve_accept,
'-R', wc_dir)
@@ -246,11 +245,6 @@ def build_simple_file_move_tests(sbox, source, dest):
copied='+', wc_rev='-')})
mc['disk'] = test['up_disk'].copy()
mc['disk'].tweak(dest, contents="This is the file 'lambda'.\nmodified\n")
- # theirs-conflict doesn't work
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
# working breaks the move
working = {}
working['output'] = svntest.verify.ExpectedOutput(
@@ -263,7 +257,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].tweak(source, status='D ')
working['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -286,15 +280,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'] = svntest.actions.get_virginal_state(wc_dir, test['end_rev'])
test['up_status'].tweak(source, status='! ', treeconflict='C', wc_rev=None)
test['up_status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doen't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't say it broke the move it should.
working['output'] = svntest.verify.ExpectedOutput(
@@ -306,7 +296,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].remove(source)
working['disk'] = test['up_disk']
working['revert_paths'] = [dest_path]
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [dest_path, source_path]
tests.append(test)
@@ -331,15 +321,11 @@ def build_simple_file_move_tests(sbox, source, dest):
# XXX: Is entry_status=' ' really right here?
test['up_status'].tweak(source, status='! ', treeconflict='C', entry_status=' ')
test['up_status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Broke the move but doesn't notify that it does.
working['output'] = svntest.verify.ExpectedOutput(
@@ -350,7 +336,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].tweak(source, status='! ')
working['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -374,15 +360,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't say what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -394,7 +376,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -419,15 +401,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
working['accept'] = 'working'
# XXX: Doesn't say what it did.
@@ -440,7 +418,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -488,15 +466,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't say what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -508,7 +482,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -532,15 +506,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't say what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -552,7 +522,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -576,15 +546,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Didn't tell us what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -596,7 +562,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -620,15 +586,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't tell you what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -640,7 +602,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -664,15 +626,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='D ', moved_to=dest)
test['up_status'].add({dest: Item(status='R ', copied='+', treeconflict='C',
wc_rev='-', moved_from=source)})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
# XXX: Doesn't tell you what it did.
working['output'] = svntest.verify.ExpectedOutput(
@@ -684,7 +642,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].add({dest: Item(status='R ', moved_from=source,
copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -720,11 +678,6 @@ def build_simple_file_move_tests(sbox, source, dest):
copied='+', wc_rev='-')})
mc['disk'] = test['up_disk'].copy()
mc['disk'].tweak(dest, props={u'foo': u'bar'})
- # theirs-conflict doesn't work
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
working['output'] = svntest.verify.ExpectedOutput(
[
@@ -737,7 +690,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].tweak(source, status='D ')
working['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -773,11 +726,6 @@ def build_simple_file_move_tests(sbox, source, dest):
copied='+', wc_rev='-')})
mc['disk'] = test['up_disk'].copy()
mc['disk'].tweak(dest, props={u'foo': u'baz'})
- # theirs-conflict doesn't work
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
working['output'] = svntest.verify.ExpectedOutput(
[
@@ -790,7 +738,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].tweak(source, status='D ')
working['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -826,11 +774,6 @@ def build_simple_file_move_tests(sbox, source, dest):
copied='+', wc_rev='-')})
mc['disk'] = test['up_disk'].copy()
mc['disk'].tweak(dest, props={})
- # theirs-conflict doesn't work
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
working['output'] = svntest.verify.ExpectedOutput(
[
@@ -843,7 +786,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].tweak(source, status='D ')
working['status'].add({dest: Item(status='A ', copied='+', wc_rev='-')})
working['disk'] = test['up_disk']
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [source_path, dest_path]
tests.append(test)
@@ -870,15 +813,11 @@ def build_simple_file_move_tests(sbox, source, dest):
test['up_status'].tweak(source, status='! ', treeconflict='C', wc_rev=None)
test['up_status'].add({dest: Item(status='R ', copied='+', wc_rev='-',
treeconflict='C')})
- # mine-conflict and theirs-conflict don't work.
+ # mine-conflict doesn't work.
mc = {}
mc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
mc['status'] = test['up_status']
mc['disk'] = test['up_disk']
- tc = {}
- tc['error'] = svntest.verify.RegexOutput(".*: .*: W155027:.*", match_all=False)
- tc['status'] = test['up_status']
- tc['disk'] = test['up_disk']
working = {}
working['output'] = svntest.verify.ExpectedOutput(
"Resolved conflicted state of '%s'\n" % source_path, match_all=False
@@ -889,7 +828,7 @@ def build_simple_file_move_tests(sbox, source, dest):
working['status'].remove(source)
working['disk'] = test['up_disk']
working['revert_paths'] = [dest_path]
- test['resolves'] = {'mine-conflict': mc, 'theirs-conflict': tc,
+ test['resolves'] = {'mine-conflict': mc,
'working': working}
test['revert_paths'] = [dest_path, source_path]
tests.append(test)
@@ -904,7 +843,7 @@ def build_simple_file_move_func(sbox, source, dest):
# Setup the move function
def move_func(rev):
# execute the move
- svntest.actions.run_and_verify_svn(None, None, [], "move",
+ svntest.actions.run_and_verify_svn(None, [], "move",
source_path, dest_path)
if move_func.extra_mv_tests:
mv_status = svntest.actions.get_virginal_state(wc_dir, rev)
@@ -914,13 +853,13 @@ def build_simple_file_move_func(sbox, source, dest):
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)),
}
]
@@ -1098,7 +1037,7 @@ def property_merge(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
sbox.simple_update()
- svntest.actions.run_and_verify_svn("resolve failed", None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'resolve',
'--accept=mine-conflict',
sbox.ospath('A/C'))
@@ -1140,29 +1079,33 @@ def property_merge(sbox):
"""Trying to add new property 'key1'
but the property already exists.
<<<<<<< (local property value)
-value2=======
-value3>>>>>>> (incoming property value)
+value2||||||| (incoming 'changed from' value)
+=======
+value3>>>>>>> (incoming 'changed to' value)
"""),
'A/C2/D5/dir_conflicts.prej' : Item(contents=
"""Trying to change property 'key1'
but the property has already been locally changed to a different value.
<<<<<<< (local property value)
-value2=======
-value3>>>>>>> (incoming property value)
+value2||||||| (incoming 'changed from' value)
+value1=======
+value3>>>>>>> (incoming 'changed to' value)
"""),
'A/C2/f4.prej' : Item(contents=
"""Trying to add new property 'key1'
but the property already exists.
<<<<<<< (local property value)
-value2=======
-value3>>>>>>> (incoming property value)
+value2||||||| (incoming 'changed from' value)
+=======
+value3>>>>>>> (incoming 'changed to' value)
"""),
'A/C2/f5.prej' : Item(contents=
"""Trying to change property 'key1'
but the property has already been locally changed to a different value.
<<<<<<< (local property value)
-value2=======
-value3>>>>>>> (incoming property value)
+value2||||||| (incoming 'changed from' value)
+value1=======
+value3>>>>>>> (incoming 'changed to' value)
"""),
})
@@ -1205,7 +1148,7 @@ def move_missing(sbox):
# This move currently fails halfway between adding the dest and
# deleting the source
- svntest.actions.run_and_verify_svn(None, None, expected_err,
+ svntest.actions.run_and_verify_svn(None, expected_err,
'mv', sbox.ospath('A/D/G'),
sbox.ospath('R'))
@@ -1213,27 +1156,119 @@ 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)
+def nested_replaces(sbox):
+ "nested replaces"
+
+ sbox.build(create_wc=False, empty=True)
+ repo_url = sbox.repo_url
+ wc_dir = sbox.wc_dir
+ ospath = sbox.ospath
+
+ ## r1: setup
+ svntest.actions.run_and_verify_svnmucc(None, [],
+ '-U', repo_url,
+ '-m', 'r1: create tree',
+ 'mkdir', 'A', 'mkdir', 'A/B', 'mkdir', 'A/B/C',
+ 'mkdir', 'X', 'mkdir', 'X/Y', 'mkdir', 'X/Y/Z',
+ # sentinel files
+ 'put', os.devnull, 'A/a',
+ 'put', os.devnull, 'A/B/b',
+ 'put', os.devnull, 'A/B/C/c',
+ 'put', os.devnull, 'X/x',
+ 'put', os.devnull, 'X/Y/y',
+ 'put', os.devnull, 'X/Y/Z/z')
+
+ svntest.main.run_svn(None, 'checkout', '-q', repo_url, wc_dir)
+ r1_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status=' ', wc_rev='1'),
+ 'A/B' : Item(status=' ', wc_rev='1'),
+ 'A/B/C' : Item(status=' ', wc_rev='1'),
+ 'X' : Item(status=' ', wc_rev='1'),
+ 'X/Y' : Item(status=' ', wc_rev='1'),
+ 'X/Y/Z' : Item(status=' ', wc_rev='1'),
+ 'A/a' : Item(status=' ', wc_rev='1'),
+ 'A/B/b' : Item(status=' ', wc_rev='1'),
+ 'A/B/C/c' : Item(status=' ', wc_rev='1'),
+ 'X/x' : Item(status=' ', wc_rev='1'),
+ 'X/Y/y' : Item(status=' ', wc_rev='1'),
+ 'X/Y/Z/z' : Item(status=' ', wc_rev='1'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir, r1_status)
+
+ ## r2: juggling
+ moves = [
+ ('A', 'A2'),
+ ('X', 'X2'),
+ ('A2/B/C', 'X'),
+ ('X2/Y/Z', 'A'),
+ ('A2/B', 'A/B'),
+ ('X2/Y', 'X/Y'),
+ ('A2', 'X/Y/Z'),
+ ('X2', 'A/B/C'),
+ ]
+ for src, dst in moves:
+ svntest.main.run_svn(None, 'mv', ospath(src), ospath(dst))
+ r2_status = svntest.wc.State(wc_dir, {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status='R ', copied='+', moved_from='X/Y/Z', moved_to='X/Y/Z', wc_rev='-'),
+ 'A/B' : Item(status='A ', copied='+', moved_from='X/Y/Z/B', wc_rev='-', entry_status='R '),
+ 'A/B/C' : Item(status='R ', copied='+', moved_from='X', moved_to='X', wc_rev='-'),
+ 'A/B/C/Y' : Item(status='D ', copied='+', wc_rev='-', moved_to='X/Y'),
+ 'A/B/C/Y/y' : Item(status='D ', copied='+', wc_rev='-'),
+ 'A/B/C/Y/Z' : Item(status='D ', copied='+', wc_rev='-'),
+ 'A/B/C/Y/Z/z':Item(status='D ', copied='+', wc_rev='-'),
+ 'X' : Item(status='R ', copied='+', moved_from='A/B/C', moved_to='A/B/C', wc_rev='-'),
+ 'X/Y' : Item(status='A ', copied='+', moved_from='A/B/C/Y', wc_rev='-', entry_status='R '),
+ 'X/Y/Z' : Item(status='R ', copied='+', moved_from='A', moved_to='A', wc_rev='-'),
+ 'X/Y/Z/B' : Item(status='D ', copied='+', wc_rev='-', moved_to='A/B'),
+ 'X/Y/Z/B/b' : Item(status='D ', copied='+', wc_rev='-'),
+ 'X/Y/Z/B/C' : Item(status='D ', copied='+', wc_rev='-'),
+ 'X/Y/Z/B/C/c':Item(status='D ', copied='+', wc_rev='-'),
+ 'A/a' : Item(status='D ', wc_rev='1'),
+ 'A/B/b' : Item(status='D ', wc_rev='1'),
+ 'A/B/C/c' : Item(status='D ', copied='+', wc_rev='-'),
+ 'X/x' : Item(status='D ', wc_rev='1'),
+ 'X/Y/y' : Item(status='D ', wc_rev='1'),
+ 'X/Y/Z/z' : Item(status='D ', copied='+', wc_rev='-'),
+ 'X/c' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/z' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/b' : Item(status=' ', copied='+', wc_rev='-'),
+ 'X/Y/y' : Item(status=' ', copied='+', wc_rev='-'),
+ 'X/Y/Z/a' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/B/C/x' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_status(wc_dir, r2_status)
+
+ svntest.main.run_svn(None, 'commit', '-m', 'r2: juggle the tree', wc_dir)
+ expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+ ' R /A (from /X/Y/Z:1)',
+ ' A /A/B (from /A/B:1)',
+ ' R /A/B/C (from /X:1)',
+ ' R /X (from /A/B/C:1)',
+ ' A /X/Y (from /X/Y:1)',
+ ' R /X/Y/Z (from /A:1)',
+ ' D /X/Y/Z/B',
+ ' D /A/B/C/Y',
+ ]) + [
+ '^-', '^r2', '^-', '^Changed paths:',
+ ])
+ svntest.actions.run_and_verify_svn(expected_output, [],
+ 'log', '-qvr2', repo_url)
+
+ ## Test updating to r1.
+ svntest.main.run_svn(None, 'update', '-r1', wc_dir)
+ svntest.actions.run_and_verify_status(wc_dir, r1_status)
+
def setup_move_many(sbox):
"helper function which creates a wc with node A/A/A which is moved 3 times"
@@ -1309,7 +1344,7 @@ def move_many_update_delete(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# And now create a tree conflict
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'rm', sbox.repo_url + '/B',
'-m', '')
@@ -1326,10 +1361,9 @@ 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
-@XFail()
def move_many_update_add(sbox):
"move many and add-on-update"
@@ -1343,7 +1377,7 @@ def move_many_update_add(sbox):
#svntest.actions.run_and_verify_status(wc_dir, expected_status)
# And now create a tree conflict
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'mkdir', sbox.repo_url + '/B/A/A/BB',
'-m', '')
@@ -1353,7 +1387,7 @@ def move_many_update_add(sbox):
'B/A/A' : Item(status=' ', treeconflict='U'),
'B/A/A/BB' : Item(status=' ', treeconflict='A'),
# And while resolving
- 'A/A/' : Item(status=' ', treeconflict='C')
+ 'A/A' : Item(status=' ', treeconflict='C')
})
expected_status.tweak('',
@@ -1369,21 +1403,28 @@ def move_many_update_add(sbox):
svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
expected_status,
- None, None, None,
- None, None, None,
+ [], False,
wc_dir, '--accept', 'mine-conflict')
# And another one
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'mkdir', sbox.repo_url + '/C/A/A/BB',
'-m', '')
expected_status.tweak('',
'B', 'B/A', 'B/A/A', 'B/A/A/A',
'C', 'C/A', 'C/A/A', 'C/A/A/A',
+ 'B/A/A/BB',
wc_rev='4')
+ expected_status.add({
+ 'C/A/A/BB' : Item(status='D ', wc_rev='4'),
+ })
+
+ expected_status.tweak('A/A/A', treeconflict='C')
+
expected_output = svntest.wc.State(wc_dir, {
+ 'A/A/A' : Item(status=' ', treeconflict='C'),
'C/A' : Item(status=' ', treeconflict='C'),
'C/A/A' : Item(status=' ', treeconflict='U'),
'C/A/A/BB' : Item(status=' ', treeconflict='A'),
@@ -1392,13 +1433,13 @@ def move_many_update_add(sbox):
# This currently triggers an assertion failure
svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
expected_status,
- None, None, None,
- None, None, None,
+ [], False,
wc_dir, '--accept', 'mine-conflict')
@Issue(4437)
def move_del_moved(sbox):
"delete moved node, still a move"
+
sbox.build()
wc_dir = sbox.wc_dir
@@ -1428,7 +1469,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
@@ -1441,7 +1482,6 @@ def copy_move_commit(sbox):
sbox.simple_move('A/D/GG', 'A/D/GG-moved')
sbox.simple_commit('A/D/GG-moved')
-
def move_to_from_external(sbox):
"move to and from an external"
@@ -1449,87 +1489,211 @@ def move_to_from_external(sbox):
sbox.simple_propset('svn:externals', '^/A/D/G GG', '')
sbox.simple_update()
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'move',
sbox.ospath('GG/tau'),
sbox.ospath('tau'))
- svntest.actions.run_and_verify_svn(None, None, [],
+ svntest.actions.run_and_verify_svn(None, [],
'move',
sbox.ospath('iota'),
sbox.ospath('GG/tau'))
-
- svntest.actions.run_and_verify_svn(None, None, [],
+
+ svntest.actions.run_and_verify_svn(None, [],
'ci', '-m', 'Commit both',
sbox.ospath(''),
sbox.ospath('GG'))
-
-def move_conflict_markers(sbox):
- "move conflict markers"
+
+def revert_del_root_of_move(sbox):
+ "revert delete root of move"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ sbox.simple_copy('A/mu', 'A/B/E/mu')
+ sbox.simple_copy('A/mu', 'A/B/F/mu')
+ sbox.simple_commit()
+ sbox.simple_update('', 1)
+ sbox.simple_move('A/B/E', 'E')
+ sbox.simple_rm('A/B')
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B' : Item(status=' ', treeconflict='C'),
+ 'A/B/E' : Item(status=' ', treeconflict='U'),
+ 'A/B/E/mu' : Item(status=' ', treeconflict='A'),
+ 'A/B/F' : Item(status=' ', treeconflict='U'),
+ 'A/B/F/mu' : Item(status=' ', treeconflict='A'),
+ })
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.tweak('A/B', status='D ', treeconflict='C')
+ expected_status.tweak('A/B/E', status='D ', moved_to='E')
+ expected_status.tweak('A/B/F', 'A/B/lambda', 'A/B/E/alpha', 'A/B/E/beta',
+ status='D ')
+ expected_status.add({
+ 'A/B/F/mu' : Item(status='D ', wc_rev='2'),
+ 'A/B/E/mu' : Item(status='D ', wc_rev='2'),
+ 'E' : Item(status='A ', copied='+', moved_from='A/B/E', wc_rev='-'),
+ 'E/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ 'E/alpha' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status)
+
+ expected_output = [
+ "Reverted '%s'\n" % sbox.ospath('A/B'), # Reverted
+ " C %s\n" % sbox.ospath('A/B/E') # New tree conflict
+ ]
+ svntest.actions.run_and_verify_svn(expected_output, [],
+ 'revert', sbox.ospath('A/B'),
+ '--depth', 'empty')
+
+ expected_status.tweak('A/B', status=' ', treeconflict=None)
+ 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()
- wc_dir = sbox.wc_dir
- sbox.simple_propset('key','val', 'iota', 'A/B/E', 'A/B/E/beta')
+
+ 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_propset('key','false', 'iota', 'A/B/E', 'A/B/E/beta')
- expected_output = svntest.wc.State(wc_dir, {
- 'A/B/E' : Item(status=' C'),
- 'A/B/E/beta' : Item(status=' C'),
- 'iota' : Item(status=' C'),
- })
- expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
- expected_status.tweak('iota', 'A/B/E', 'A/B/E/beta', status=' C')
- expected_disk = svntest.main.greek_state.copy()
- expected_disk.add({
- 'A/B/E/dir_conflicts.prej' : Item(contents=
- "Trying to add new property 'key'\n"
- "but the property already exists.\n"
- "<<<<<<< (local property value)\n"
- "false=======\n"
- "val>>>>>>> (incoming property value)\n"),
- 'A/B/E/beta.prej' : Item(contents=
- "Trying to add new property 'key'\n"
- "but the property already exists.\n"
- "<<<<<<< (local property value)\n"
- "false=======\n"
- "val>>>>>>> (incoming property value)\n"),
- 'iota.prej' : Item(contents=
- "Trying to add new property 'key'\n"
- "but the property already exists.\n"
- "<<<<<<< (local property value)\n"
- "false=======\n"
- "val>>>>>>> (incoming property value)\n"),
- })
- svntest.actions.run_and_verify_update(wc_dir,
- expected_output,
- expected_disk,
- expected_status)
+ sbox.simple_move('A/B', 'B')
- sbox.simple_move('iota', 'A/iotb')
- sbox.simple_move('A/B/E', 'E')
+ 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')
- expected_status.tweak('iota', status='D ', moved_to='A/iotb')
- expected_status.tweak('A/B/E', status='D ', moved_to='E')
- expected_status.tweak('A/B/E/alpha', 'A/B/E/beta', status='D ')
- expected_status.add({
- 'A/iotb' : Item(status='A ', copied='+', moved_from='iota', wc_rev='-'),
- 'E' : Item(status='A ', copied='+', moved_from='A/B/E', wc_rev='-'),
- 'E/beta' : Item(status=' M', copied='+', wc_rev='-'),
- 'E/alpha' : Item(status=' ', copied='+', wc_rev='-'),
- })
- expected_disk.remove('iota', 'iota.prej',
- 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
- 'A/B/E/dir_conflicts.prej',
- 'A/B/E/beta.prej')
- expected_disk.add({
- 'A/iotb' : Item(contents="This is the file 'iota'.\n"),
- 'E/beta' : Item(contents="This is the file 'beta'.\n"),
- 'E/alpha' : Item(contents="This is the file 'alpha'.\n"),
- })
- svntest.actions.run_and_verify_status(wc_dir, expected_status)
- svntest.actions.verify_disk(wc_dir, expected_disk)
#######################################################################
# Run the tests
@@ -1542,12 +1706,14 @@ test_list = [ None,
deeper_move_file_test,
property_merge,
move_missing,
+ nested_replaces,
move_many_update_delete,
move_many_update_add,
move_del_moved,
copy_move_commit,
move_to_from_external,
- move_conflict_markers,
+ revert_del_root_of_move,
+ move_conflict_details,
]
if __name__ == '__main__':