51
51
from svntest.actions import inject_conflict_into_expected_state
52
52
from svntest.verify import RegexListOutput
54
def expected_merge_output(rev_ranges, additional_lines=[], foreign=False,
55
elides=False, two_url=False, target=None,
56
text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
57
text_resolved=0, prop_resolved=0, tree_resolved=0,
59
"""Generate an (inefficient) regex representing the expected merge
60
output and mergeinfo notifications from REV_RANGES and ADDITIONAL_LINES.
62
REV_RANGES is a list of revision ranges for which mergeinfo is being
63
recorded. Each range is of the form [start, end] (where both START and
64
END are inclusive, unlike in '-rX:Y') or the form [single_rev] (which is
65
like '-c SINGLE_REV'). If REV_RANGES is None then only the standard
66
notification for a 3-way merge is expected.
68
ADDITIONAL_LINES is a list of strings to match the other lines of output;
69
these are basically regular expressions except that backslashes will be
70
escaped herein. If ADDITIONAL_LINES is a single string, it is interpreted
71
the same as a list containing that string.
73
If ELIDES is true, add to the regex an expression representing elision
74
notification. If TWO_URL is true, tweak the regex to expect the
75
appropriate mergeinfo notification for a 3-way merge.
77
TARGET is the local path to the target, as it should appear in
78
notifications; if None, it is not checked.
80
TEXT_CONFLICTS, PROP_CONFLICTS, TREE_CONFLICTS and SKIPPED_PATHS specify
81
the number of each kind of conflict to expect.
84
if rev_ranges is None:
85
lines = [svntest.main.merge_notify_line(None, None, False, foreign)]
88
for rng in rev_ranges:
94
lines += [svntest.main.merge_notify_line(start_rev, end_rev,
95
True, foreign, target)]
96
lines += [svntest.main.mergeinfo_notify_line(start_rev, end_rev, target)]
99
lines += ["--- Eliding mergeinfo from .*\n"]
102
lines += ["--- Recording mergeinfo for merge between repository URLs .*\n"]
104
# Address "The Backslash Plague"
106
# If ADDITIONAL_LINES are present there are possibly paths in it with
107
# multiple components and on Windows these components are separated with
108
# '\'. These need to be escaped properly in the regexp for the match to
109
# work correctly. See http://aspn.activestate.com/ASPN/docs/ActivePython
110
# /2.2/howto/regex/regex.html#SECTION000420000000000000000.
111
if isinstance(additional_lines, str):
112
additional_lines = [additional_lines]
113
if sys.platform == 'win32':
114
additional_lines = [line.replace("\\", "\\\\") for line in additional_lines]
115
lines += additional_lines
117
lines += svntest.main.summary_of_conflicts(
118
text_conflicts, prop_conflicts, tree_conflicts,
119
text_resolved, prop_resolved, tree_resolved,
123
return "|".join(lines)
125
def check_mergeinfo_recursively(root_path, subpaths_mergeinfo):
126
"""Check that the mergeinfo properties on and under ROOT_PATH are those in
127
SUBPATHS_MERGEINFO, a {path: mergeinfo-prop-val} dictionary."""
128
expected = svntest.verify.UnorderedOutput(
129
[path + ' - ' + subpaths_mergeinfo[path] + '\n'
130
for path in subpaths_mergeinfo])
131
svntest.actions.run_and_verify_svn(None, expected, [],
132
'propget', '-R', SVN_PROP_MERGEINFO,
54
from svntest.mergetrees import expected_merge_output, \
55
check_mergeinfo_recursively, \
63
noninheritable_mergeinfo_test_set_up
135
65
######################################################################
601
517
expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
602
518
wc_rev=2, status=' ')
603
519
svntest.actions.run_and_verify_commit(wc_dir,
604
expected_output, expected_status,
606
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
520
expected_output, expected_status)
521
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
608
523
# Copy B to B2 as rev 3
609
524
B_url = sbox.repo_url + '/A/B'
610
525
B2_url = sbox.repo_url + '/A/B2'
612
svntest.actions.run_and_verify_svn(None, None, [],
527
svntest.actions.run_and_verify_svn(None, [],
613
528
'copy', '-m', 'copy B to B2',
615
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
530
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
617
532
# Modify a property and add a property for the file and directory
618
svntest.actions.run_and_verify_svn(None, None, [],
533
svntest.actions.run_and_verify_svn(None, [],
619
534
'propset', 'foo', 'mod_foo', alpha_path)
620
svntest.actions.run_and_verify_svn(None, None, [],
535
svntest.actions.run_and_verify_svn(None, [],
621
536
'propset', 'bar', 'bar_val', alpha_path)
622
svntest.actions.run_and_verify_svn(None, None, [],
537
svntest.actions.run_and_verify_svn(None, [],
623
538
'propset', 'foo', 'mod\201foo', beta_path)
624
svntest.actions.run_and_verify_svn(None, None, [],
539
svntest.actions.run_and_verify_svn(None, [],
625
540
'propset', 'bar', 'bar\201val', beta_path)
626
svntest.actions.run_and_verify_svn(None, None, [],
541
svntest.actions.run_and_verify_svn(None, [],
627
542
'propset', 'foo', 'mod_foo', E_path)
628
svntest.actions.run_and_verify_svn(None, None, [],
543
svntest.actions.run_and_verify_svn(None, [],
629
544
'propset', 'bar', 'bar_val', E_path)
631
546
# Commit change as rev 4
2236
2107
os.mkdir(tpath)
2237
2108
svntest.main.run_svn(None, "add", tpath)
2239
svntest.actions.run_and_verify_svn(None, None, [],
2110
svntest.actions.run_and_verify_svn(None, [],
2240
2111
"ci", "-m", "r2", wcpath)
2243
2114
svntest.main.run_svn(None, "cp", tpath, bpath)
2245
svntest.actions.run_and_verify_svn(None, None, [],
2116
svntest.actions.run_and_verify_svn(None, [],
2246
2117
"ci", "-m", "r3", wcpath)
2248
2119
# Add a file to t.
2249
2120
svntest.main.file_append(t_fpath, "$Revision$")
2250
svntest.actions.run_and_verify_svn(None, None, [],
2121
svntest.actions.run_and_verify_svn(None, [],
2251
2122
'add', t_fpath)
2252
2123
# Ask for keyword expansion in the file.
2253
svntest.actions.run_and_verify_svn(None, None, [],
2124
svntest.actions.run_and_verify_svn(None, [],
2254
2125
'propset', 'svn:keywords', 'Revision',
2257
svntest.actions.run_and_verify_svn(None, None, [],
2128
svntest.actions.run_and_verify_svn(None, [],
2258
2129
'ci', '-m', 'r4', wcpath)
2260
2131
# Update the wc before the merge.
2261
svntest.actions.run_and_verify_svn(None, None, [],
2132
svntest.actions.run_and_verify_svn(None, [],
2262
2133
'update', wcpath)
2264
2135
expected_status = svntest.actions.get_virginal_state(wcpath, 4)
2341
2211
# --ignore-ancestry here because our merge logic will otherwise
2342
2212
# prevent a merge of changes we already have.
2343
2213
os.chdir(wc_dir)
2344
svntest.actions.run_and_verify_svn("Merge errored unexpectedly",
2345
svntest.verify.AnyOutput, [], 'merge',
2214
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], 'merge',
2346
2215
'-r1:2', '--ignore-ancestry', '.')
2348
2217
#----------------------------------------------------------------------
2349
def set_up_dir_replace(sbox):
2350
"""Set up the working copy for directory replace tests, creating
2351
directory 'A/B/F/foo' with files 'new file' and 'new file2' within
2352
it (r2), and merging 'foo' onto 'C' (r3), then deleting 'A/B/F/foo'
2356
wc_dir = sbox.wc_dir
2358
C_path = sbox.ospath('A/C')
2359
F_path = sbox.ospath('A/B/F')
2360
F_url = sbox.repo_url + '/A/B/F'
2362
foo_path = os.path.join(F_path, 'foo')
2363
new_file = os.path.join(foo_path, "new file")
2364
new_file2 = os.path.join(foo_path, "new file 2")
2366
# Make directory foo in F, and add some files within it.
2367
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', foo_path)
2368
svntest.main.file_append(new_file, "Initial text in new file.\n")
2369
svntest.main.file_append(new_file2, "Initial text in new file 2.\n")
2370
svntest.main.run_svn(None, "add", new_file)
2371
svntest.main.run_svn(None, "add", new_file2)
2373
# Commit all the new content, creating r2.
2374
expected_output = wc.State(wc_dir, {
2375
'A/B/F/foo' : Item(verb='Adding'),
2376
'A/B/F/foo/new file' : Item(verb='Adding'),
2377
'A/B/F/foo/new file 2' : Item(verb='Adding'),
2379
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2380
expected_status.add({
2381
'A/B/F/foo' : Item(status=' ', wc_rev=2),
2382
'A/B/F/foo/new file' : Item(status=' ', wc_rev=2),
2383
'A/B/F/foo/new file 2' : Item(status=' ', wc_rev=2),
2385
svntest.actions.run_and_verify_commit(wc_dir,
2391
expected_output = wc.State(C_path, {
2392
'foo' : Item(status='A '),
2393
'foo/new file' : Item(status='A '),
2394
'foo/new file 2' : Item(status='A '),
2396
expected_mergeinfo_output = wc.State(C_path, {
2397
'' : Item(status=' U'),
2399
expected_elision_output = wc.State(C_path, {
2401
expected_disk = wc.State('', {
2402
'' : Item(props={SVN_PROP_MERGEINFO : '/A/B/F:2'}),
2404
'foo/new file' : Item("Initial text in new file.\n"),
2405
'foo/new file 2' : Item("Initial text in new file 2.\n"),
2407
expected_status = wc.State(C_path, {
2408
'' : Item(status=' M', wc_rev=1),
2409
'foo' : Item(status='A ', wc_rev='-', copied='+'),
2410
'foo/new file' : Item(status=' ', wc_rev='-', copied='+'),
2411
'foo/new file 2' : Item(status=' ', wc_rev='-', copied='+'),
2413
expected_skip = wc.State(C_path, { })
2414
svntest.actions.run_and_verify_merge(C_path, '1', '2', F_url, None,
2416
expected_mergeinfo_output,
2417
expected_elision_output,
2421
None, None, None, None, None, 1)
2422
# Commit merge of foo onto C, creating r3.
2423
expected_output = svntest.wc.State(wc_dir, {
2424
'A/C' : Item(verb='Sending'),
2425
'A/C/foo' : Item(verb='Adding'),
2427
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2428
expected_status.add({
2429
'A/B/F/foo' : Item(status=' ', wc_rev=2),
2430
'A/C' : Item(status=' ', wc_rev=3),
2431
'A/B/F/foo/new file' : Item(status=' ', wc_rev=2),
2432
'A/B/F/foo/new file 2' : Item(status=' ', wc_rev=2),
2433
'A/C/foo' : Item(status=' ', wc_rev=3),
2434
'A/C/foo/new file' : Item(status=' ', wc_rev=3),
2435
'A/C/foo/new file 2' : Item(status=' ', wc_rev=3),
2438
svntest.actions.run_and_verify_commit(wc_dir,
2443
# Delete foo on F, creating r4.
2444
svntest.actions.run_and_verify_svn(None, None, [], 'rm', foo_path)
2445
expected_output = svntest.wc.State(wc_dir, {
2446
'A/B/F/foo' : Item(verb='Deleting'),
2448
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2449
expected_status.add({
2450
'A/C' : Item(status=' ', wc_rev=3),
2451
'A/C/foo' : Item(status=' ', wc_rev=3),
2452
'A/C/foo/new file' : Item(status=' ', wc_rev=3),
2453
'A/C/foo/new file 2' : Item(status=' ', wc_rev=3),
2455
svntest.actions.run_and_verify_commit(wc_dir,
2460
#----------------------------------------------------------------------
2461
2218
# A merge that replaces a directory
2462
2219
# Tests for Issue #2144 and Issue #2607
2463
2220
@SkipUnless(server_has_mergeinfo)
2809
2560
expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
2810
2561
wc_rev=2, status=' ')
2811
2562
svntest.actions.run_and_verify_commit(wc_dir,
2812
expected_output, expected_status,
2814
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2563
expected_output, expected_status)
2564
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2816
2566
# Copy B to B2 as rev 3 (making a branch)
2817
2567
B_url = sbox.repo_url + '/A/B'
2818
2568
B2_url = sbox.repo_url + '/A/B2'
2820
svntest.actions.run_and_verify_svn(None, None, [],
2570
svntest.actions.run_and_verify_svn(None, [],
2821
2571
'copy', '-m', 'copy B to B2',
2823
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2573
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2825
2575
# Change the properties underneath B again, and commit as r4
2826
svntest.actions.run_and_verify_svn(None, None, [],
2576
svntest.actions.run_and_verify_svn(None, [],
2827
2577
'propset', 'foo', 'foo_val2',
2829
svntest.actions.run_and_verify_svn(None, None, [],
2579
svntest.actions.run_and_verify_svn(None, [],
2830
2580
'propdel', 'foo',
2832
svntest.actions.run_and_verify_svn(None, None, [],
2582
svntest.actions.run_and_verify_svn(None, [],
2833
2583
'propset', 'foo', 'foo_val2',
2835
2585
expected_output = svntest.wc.State(wc_dir, {
2937
2682
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2938
2683
expected_status.tweak('A/B/E', 'A/B/E/alpha', wc_rev=2, status=' ')
2939
2684
svntest.actions.run_and_verify_commit(wc_dir,
2940
expected_output, expected_status,
2942
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2685
expected_output, expected_status)
2686
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2944
2688
# Copy B to B2 as rev 3 (making a branch)
2945
2689
B_url = sbox.repo_url + '/A/B'
2946
2690
B2_url = sbox.repo_url + '/A/B2'
2948
svntest.actions.run_and_verify_svn(None, None, [],
2692
svntest.actions.run_and_verify_svn(None, [],
2949
2693
'copy', '-m', 'copy B to B2',
2951
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2695
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2953
2697
# Change the properties underneath B again, and commit as r4
2954
svntest.actions.run_and_verify_svn(None, None, [],
2698
svntest.actions.run_and_verify_svn(None, [],
2955
2699
'propset', 'foo', 'foo_val2',
2957
svntest.actions.run_and_verify_svn(None, None, [],
2701
svntest.actions.run_and_verify_svn(None, [],
2958
2702
'propset', 'foo', 'foo_val2',
2960
2704
expected_output = svntest.wc.State(wc_dir, {
4473
4164
expected_status,
4481
#----------------------------------------------------------------------
4482
def set_up_branch(sbox, branch_only = False, nbr_of_branches = 1):
4483
'''Starting with standard greek tree, copy 'A' NBR_OF_BRANCHES times
4484
to A_COPY, A_COPY_2, A_COPY_3, and so on. Then make four modifications
4485
(setting file contents to "New content") under A:
4486
r(2 + NBR_OF_BRANCHES) - A/D/H/psi
4487
r(3 + NBR_OF_BRANCHES) - A/D/G/rho
4488
r(4 + NBR_OF_BRANCHES) - A/B/E/beta
4489
r(5 + NBR_OF_BRANCHES) - A/D/H/omega
4490
Return (expected_disk, expected_status).'''
4492
# With the default parameters, the branching looks like this:
4494
# A -1-----3-4-5-6--
4496
# A_COPY 2-----------
4498
wc_dir = sbox.wc_dir
4500
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
4501
expected_disk = svntest.main.greek_state.copy()
4503
def copy_A(dest_name, rev):
4504
expected = svntest.verify.UnorderedOutput(
4505
["A " + os.path.join(wc_dir, dest_name, "B") + "\n",
4506
"A " + os.path.join(wc_dir, dest_name, "B", "lambda") + "\n",
4507
"A " + os.path.join(wc_dir, dest_name, "B", "E") + "\n",
4508
"A " + os.path.join(wc_dir, dest_name, "B", "E", "alpha") + "\n",
4509
"A " + os.path.join(wc_dir, dest_name, "B", "E", "beta") + "\n",
4510
"A " + os.path.join(wc_dir, dest_name, "B", "F") + "\n",
4511
"A " + os.path.join(wc_dir, dest_name, "mu") + "\n",
4512
"A " + os.path.join(wc_dir, dest_name, "C") + "\n",
4513
"A " + os.path.join(wc_dir, dest_name, "D") + "\n",
4514
"A " + os.path.join(wc_dir, dest_name, "D", "gamma") + "\n",
4515
"A " + os.path.join(wc_dir, dest_name, "D", "G") + "\n",
4516
"A " + os.path.join(wc_dir, dest_name, "D", "G", "pi") + "\n",
4517
"A " + os.path.join(wc_dir, dest_name, "D", "G", "rho") + "\n",
4518
"A " + os.path.join(wc_dir, dest_name, "D", "G", "tau") + "\n",
4519
"A " + os.path.join(wc_dir, dest_name, "D", "H") + "\n",
4520
"A " + os.path.join(wc_dir, dest_name, "D", "H", "chi") + "\n",
4521
"A " + os.path.join(wc_dir, dest_name, "D", "H", "omega") + "\n",
4522
"A " + os.path.join(wc_dir, dest_name, "D", "H", "psi") + "\n",
4523
"Checked out revision " + str(rev - 1) + ".\n",
4524
"A " + os.path.join(wc_dir, dest_name) + "\n"])
4525
expected_status.add({
4526
dest_name + "/B" : Item(status=' ', wc_rev=rev),
4527
dest_name + "/B/lambda" : Item(status=' ', wc_rev=rev),
4528
dest_name + "/B/E" : Item(status=' ', wc_rev=rev),
4529
dest_name + "/B/E/alpha" : Item(status=' ', wc_rev=rev),
4530
dest_name + "/B/E/beta" : Item(status=' ', wc_rev=rev),
4531
dest_name + "/B/F" : Item(status=' ', wc_rev=rev),
4532
dest_name + "/mu" : Item(status=' ', wc_rev=rev),
4533
dest_name + "/C" : Item(status=' ', wc_rev=rev),
4534
dest_name + "/D" : Item(status=' ', wc_rev=rev),
4535
dest_name + "/D/gamma" : Item(status=' ', wc_rev=rev),
4536
dest_name + "/D/G" : Item(status=' ', wc_rev=rev),
4537
dest_name + "/D/G/pi" : Item(status=' ', wc_rev=rev),
4538
dest_name + "/D/G/rho" : Item(status=' ', wc_rev=rev),
4539
dest_name + "/D/G/tau" : Item(status=' ', wc_rev=rev),
4540
dest_name + "/D/H" : Item(status=' ', wc_rev=rev),
4541
dest_name + "/D/H/chi" : Item(status=' ', wc_rev=rev),
4542
dest_name + "/D/H/omega" : Item(status=' ', wc_rev=rev),
4543
dest_name + "/D/H/psi" : Item(status=' ', wc_rev=rev),
4544
dest_name : Item(status=' ', wc_rev=rev)})
4547
dest_name + '/B' : Item(),
4548
dest_name + '/B/lambda' : Item("This is the file 'lambda'.\n"),
4549
dest_name + '/B/E' : Item(),
4550
dest_name + '/B/E/alpha' : Item("This is the file 'alpha'.\n"),
4551
dest_name + '/B/E/beta' : Item("This is the file 'beta'.\n"),
4552
dest_name + '/B/F' : Item(),
4553
dest_name + '/mu' : Item("This is the file 'mu'.\n"),
4554
dest_name + '/C' : Item(),
4555
dest_name + '/D' : Item(),
4556
dest_name + '/D/gamma' : Item("This is the file 'gamma'.\n"),
4557
dest_name + '/D/G' : Item(),
4558
dest_name + '/D/G/pi' : Item("This is the file 'pi'.\n"),
4559
dest_name + '/D/G/rho' : Item("This is the file 'rho'.\n"),
4560
dest_name + '/D/G/tau' : Item("This is the file 'tau'.\n"),
4561
dest_name + '/D/H' : Item(),
4562
dest_name + '/D/H/chi' : Item("This is the file 'chi'.\n"),
4563
dest_name + '/D/H/omega' : Item("This is the file 'omega'.\n"),
4564
dest_name + '/D/H/psi' : Item("This is the file 'psi'.\n"),
4567
# Make a branch A_COPY to merge into.
4568
svntest.actions.run_and_verify_svn(None, expected, [], 'copy',
4569
sbox.repo_url + "/A",
4570
os.path.join(wc_dir,
4573
expected_output = wc.State(wc_dir, {dest_name : Item(verb='Adding')})
4574
svntest.actions.run_and_verify_commit(wc_dir,
4579
for i in range(nbr_of_branches):
4581
copy_A('A_COPY', i + 2)
4583
copy_A('A_COPY_' + str(i + 1), i + 2)
4586
return expected_disk, expected_status
4588
# Make some changes under A which we'll later merge under A_COPY:
4590
# r(nbr_of_branches + 2) - modify and commit A/D/H/psi
4591
svntest.main.file_write(sbox.ospath('A/D/H/psi'),
4593
expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
4594
expected_status.tweak('A/D/H/psi', wc_rev=nbr_of_branches + 2)
4595
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4596
expected_status, None, wc_dir)
4597
expected_disk.tweak('A/D/H/psi', contents="New content")
4599
# r(nbr_of_branches + 3) - modify and commit A/D/G/rho
4600
svntest.main.file_write(sbox.ospath('A/D/G/rho'),
4602
expected_output = wc.State(wc_dir, {'A/D/G/rho' : Item(verb='Sending')})
4603
expected_status.tweak('A/D/G/rho', wc_rev=nbr_of_branches + 3)
4604
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4605
expected_status, None, wc_dir)
4606
expected_disk.tweak('A/D/G/rho', contents="New content")
4608
# r(nbr_of_branches + 4) - modify and commit A/B/E/beta
4609
svntest.main.file_write(sbox.ospath('A/B/E/beta'),
4611
expected_output = wc.State(wc_dir, {'A/B/E/beta' : Item(verb='Sending')})
4612
expected_status.tweak('A/B/E/beta', wc_rev=nbr_of_branches + 4)
4613
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4614
expected_status, None, wc_dir)
4615
expected_disk.tweak('A/B/E/beta', contents="New content")
4617
# r(nbr_of_branches + 5) - modify and commit A/D/H/omega
4618
svntest.main.file_write(sbox.ospath('A/D/H/omega'),
4620
expected_output = wc.State(wc_dir, {'A/D/H/omega' : Item(verb='Sending')})
4621
expected_status.tweak('A/D/H/omega', wc_rev=nbr_of_branches + 5)
4622
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4623
expected_status, None, wc_dir)
4624
expected_disk.tweak('A/D/H/omega', contents="New content")
4626
return expected_disk, expected_status
4628
4168
#----------------------------------------------------------------------
4629
4169
@SkipUnless(server_has_mergeinfo)
6529
6041
# We'll consider A as the trunk and A_COPY as the feature branch
6530
6042
# r3 - Create a tfile1 in A
6531
6043
svntest.main.file_write(tfile1_path, tfile1_content)
6532
svntest.actions.run_and_verify_svn(None, None, [], 'add', tfile1_path)
6044
svntest.actions.run_and_verify_svn(None, [], 'add', tfile1_path)
6533
6045
expected_output = wc.State(wc_dir, {'A/tfile1' : Item(verb='Adding')})
6534
6046
wc_status.add({'A/tfile1' : Item(status=' ', wc_rev=3)})
6535
6047
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6536
wc_status, None, wc_dir)
6538
6050
# r4 - Create a bfile1 in A_COPY
6539
6051
svntest.main.file_write(bfile1_path, bfile1_content)
6540
svntest.actions.run_and_verify_svn(None, None, [], 'add', bfile1_path)
6052
svntest.actions.run_and_verify_svn(None, [], 'add', bfile1_path)
6541
6053
expected_output = wc.State(wc_dir, {'A_COPY/bfile1' : Item(verb='Adding')})
6542
6054
wc_status.add({'A_COPY/bfile1' : Item(status=' ', wc_rev=4)})
6543
6055
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6544
wc_status, None, wc_dir)
6546
6058
# r5 - Create one more file in A
6547
6059
svntest.main.file_write(tfile2_path, tfile2_content)
6548
svntest.actions.run_and_verify_svn(None, None, [], 'add', tfile2_path)
6060
svntest.actions.run_and_verify_svn(None, [], 'add', tfile2_path)
6549
6061
expected_output = wc.State(wc_dir, {'A/tfile2' : Item(verb='Adding')})
6550
6062
wc_status.add({'A/tfile2' : Item(status=' ', wc_rev=5)})
6551
6063
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6552
wc_status, None, wc_dir)
6554
6066
# Merge r5 from /A to /A_COPY, creating r6
6555
6067
expected_output = wc.State(A_COPY_path, {
7384
6890
expected_elision_output,
7386
6892
expected_status, expected_skip,
7387
None, None, None, None, None, 1, 1)
7389
6895
# Now test the problem described in
7390
6896
# http://svn.haxx.se/dev/archive-2008-12/0133.shtml.
7392
6898
# First revert all local mods.
7393
svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
6899
svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7395
6901
# r9: Merge all available revisions from A to A_COPY at a depth of empty
7396
6902
# this will create non-inheritable mergeinfo on A_COPY.
7397
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
6903
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7398
6904
wc_status.tweak(wc_rev=8)
7399
svntest.actions.run_and_verify_svn(None, None, [],
6905
svntest.actions.run_and_verify_svn(None, [],
7400
6906
'merge', '--depth', 'empty',
7401
6907
sbox.repo_url + '/A', A_COPY_path)
7402
6908
wc_status.tweak('A_COPY', wc_rev=9)
7403
6909
expected_output = wc.State(wc_dir, {'A_COPY' : Item(verb='Sending')})
7404
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
7405
wc_status, None, wc_dir)
6910
svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
7407
6912
# r10: Add the file A/nu.
7408
6913
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
7409
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
6914
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
7410
6915
expected_output = wc.State(wc_dir, {'A/nu' : Item(verb='Adding')})
7411
6916
wc_status.add({'A/nu' : Item(status=' ', wc_rev=10)})
7412
6917
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
7413
wc_status, None, wc_dir)
7415
6920
# Now merge -c10 from A to A_COPY.
7416
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
6921
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7417
6922
expected_output = wc.State('', {
7418
6923
'nu': Item(status='A '),
7651
7152
expected_elision_output,
7653
7154
expected_status, expected_skip,
7654
None, None, None, None, None, 1)
7656
7157
# Test issue #3407 'Shallow merges incorrectly set mergeinfo on children'.
7658
7159
# Revert all local mods.
7659
svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
7160
svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7661
7162
# Merge all available changes from A to A_COPY at --depth empty. Only the
7662
7163
# mergeinfo on A_COPY should be affected.
7663
7164
svntest.actions.run_and_verify_svn(
7665
7165
expected_merge_output([[9,13]],
7666
7166
[' U ' + A_COPY_path + '\n']),
7667
7167
[], 'merge', '--depth', 'empty',
7668
7168
sbox.repo_url + '/A', A_COPY_path)
7669
svntest.actions.run_and_verify_svn(None,
7670
[A_COPY_path + ' - /A:2-13*\n'],
7169
svntest.actions.run_and_verify_svn([A_COPY_path + ' - /A:2-13*\n'],
7671
7170
[], 'pg', SVN_PROP_MERGEINFO,
7672
7171
'-R', A_COPY_path)
7674
7173
# Merge all available changes from A to A_COPY at --depth files. Only the
7675
7174
# mergeinfo on A_COPY and its file children should be affected.
7676
svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
7175
svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7677
7176
# Revisions 2-13 are already merged to A_COPY and now they will be merged
7678
7177
# to A_COPY's file children. Due to the way we drive the merge editor
7679
7178
# r2-3, which are inoperative on A_COPY's file children, do not show up
8648
8136
wc_status.tweak(wc_rev='6')
8649
8137
svntest.actions.run_and_verify_update(wc_dir, expected_output,
8650
8138
wc_disk, wc_status,
8651
None, None, None, None, None, True)
8653
8141
# Make some prop changes to some dirs.
8654
svntest.actions.run_and_verify_svn(None,
8655
["property 'prop:name' set on '" +
8142
svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
8656
8143
G_path + "'\n"], [], 'ps',
8657
8144
'prop:name', 'propval', G_path)
8658
8145
expected_output = svntest.wc.State(wc_dir, {'A/D/G': Item(verb='Sending'),})
8659
8146
wc_status.tweak('A/D/G', wc_rev=7)
8660
8147
wc_disk.tweak('A/D/G', props={'prop:name' : 'propval'})
8662
svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
8664
svntest.actions.run_and_verify_svn(None,
8665
["property 'prop:name' set on '" +
8149
svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
8150
svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
8666
8151
H_path + "'\n"], [], 'ps',
8667
8152
'prop:name', 'propval', H_path)
8668
8153
expected_output = svntest.wc.State(wc_dir, {'A/D/H': Item(verb='Sending'),})
8669
8154
wc_status.tweak('A/D/H', wc_rev=8)
8670
8155
wc_disk.tweak('A/D/H', props={'prop:name' : 'propval'})
8671
svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
8156
svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
8674
8158
# Do multiple additive merges to a file"
8675
8159
# Merge -r2:4 -c6 into A_COPY/D/G/rho.
11087
10530
expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
11088
10531
expected_status.tweak('A/D/H/psi', wc_rev=2)
11089
10532
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11090
expected_status, None, wc_dir)
11091
10534
expected_disk.tweak('A/D/H/psi', contents="New content")
11093
10536
# Create 'A/D/H/nu' and commit it as r3.
11094
10537
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
11095
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
10538
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
11096
10539
expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
11097
10540
expected_status.add({'A/D/H/nu' : Item(status=' ', wc_rev=3)})
11098
10541
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11099
expected_status, None, wc_dir)
11101
10544
# Delete 'A/D/H/nu' and commit it as r4.
11102
svntest.actions.run_and_verify_svn(None, None, [], 'rm', nu_path)
10545
svntest.actions.run_and_verify_svn(None, [], 'rm', nu_path)
11103
10546
expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Deleting')})
11104
10547
expected_status.remove('A/D/H/nu')
11105
10548
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11106
expected_status, None, wc_dir)
11108
10551
# Copy 'A/D/H/nu' from r3 and commit it as r5.
11109
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
10552
svntest.actions.run_and_verify_svn(None, [], 'cp',
11110
10553
sbox.repo_url + '/A/D/H/nu@3', nu_path)
11111
10554
expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
11112
10555
expected_status.add({'A/D/H/nu' : Item(status=' ', wc_rev=5)})
11113
10556
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11114
expected_status, None, wc_dir)
11116
10559
# Copy 'A/D/H' to 'H_COPY' in r6.
11117
svntest.actions.run_and_verify_svn(None,
11118
['\n', 'Committed revision 6.\n'],
10560
svntest.actions.run_and_verify_svn(['Committing transaction...\n',
10561
'Committed revision 6.\n'],
11120
10563
sbox.repo_url + "/A/D/H",
11121
10564
sbox.repo_url + "/H_COPY",
12505
11934
{'A_COPY/D/H/N/nu' : Item(verb='Sending')})
12506
11935
wc_status.tweak('A_COPY/D/H/N/nu', wc_rev=5)
12507
11936
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12508
wc_status, None, wc_dir)
12509
11938
# The second place issue #3240 shows up is in the fact that the commit
12510
11939
# *did* succeed, but the wrong path ('A/D/H/nu' rather than 'A_COPY/D/H/nu')
12511
11940
# is affected. We can see this by running an update; since we just
12512
11941
# committed there shouldn't be any incoming changes.
12513
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [], 'up',
11942
svntest.actions.run_and_verify_svn(exp_noop_up_out(5), [], 'up',
12517
11946
#----------------------------------------------------------------------
12518
# Helper functions. These take local paths using '/' separators.
12520
def local_path(path):
12521
"Convert a path from '/' separators to the local style."
12522
return os.sep.join(path.split('/'))
12524
def svn_mkfile(path):
12525
"Make and add a file with some default content, and keyword expansion."
12526
path = local_path(path)
12527
dirname, filename = os.path.split(path)
12528
svntest.main.file_write(path, "This is the file '" + filename + "'.\n" +
12529
"Last changed in '$Revision$'.\n")
12530
svntest.actions.run_and_verify_svn(None, None, [], 'add', path)
12531
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
12532
'svn:keywords', 'Revision', path)
12534
def svn_modfile(path):
12535
"Make text and property mods to a WC file."
12536
path = local_path(path)
12537
svntest.main.file_append(path, "An extra line.\n")
12538
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
12539
'newprop', 'v', path)
12541
def svn_copy(s_rev, path1, path2):
12542
"Copy a WC path locally."
12543
path1 = local_path(path1)
12544
path2 = local_path(path2)
12545
svntest.actions.run_and_verify_svn(None, None, [], 'copy', '--parents',
12546
'-r', s_rev, path1, path2)
12548
def svn_merge(rev_range, source, target, lines=None, elides=[],
12549
text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
12550
text_resolved=0, prop_resolved=0, tree_resolved=0,
12552
"""Merge a single change from path SOURCE to path TARGET and verify the
12553
output and that there is no error. (The changes made are not verified.)
12555
REV_RANGE is either a number (to cherry-pick that specific change) or a
12556
two-element list [X,Y] to pick the revision range '-r(X-1):Y'.
12558
LINES is a list of regular expressions to match other lines of output; if
12559
LINES is 'None' then match all normal (non-conflicting) merges.
12561
ELIDES is a list of paths on which mergeinfo elision should be reported.
12563
TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
12564
each kind of conflict to expect.
12566
ARGS are additional arguments passed to svn merge.
12569
source = local_path(source)
12570
target = local_path(target)
12571
elides = [local_path(p) for p in elides]
12572
if isinstance(rev_range, int):
12573
mi_rev_range = [rev_range]
12574
rev_arg = '-c' + str(rev_range)
12576
mi_rev_range = rev_range
12577
rev_arg = '-r' + str(rev_range[0] - 1) + ':' + str(rev_range[1])
12579
lines = ["(A |D |[UG] | [UG]|[UG][UG]) " + target + ".*\n"]
12581
# Expect mergeinfo on the target; caller must supply matches for any
12582
# subtree mergeinfo paths.
12583
lines.append(" [UG] " + target + "\n")
12584
exp_out = expected_merge_output([mi_rev_range], lines, target=target,
12586
text_conflicts=text_conflicts,
12587
prop_conflicts=prop_conflicts,
12588
tree_conflicts=tree_conflicts,
12589
text_resolved=text_resolved,
12590
prop_resolved=prop_resolved,
12591
tree_resolved=tree_resolved)
12592
svntest.actions.run_and_verify_svn(None, exp_out, [],
12593
'merge', rev_arg, source, target, *args)
12595
#----------------------------------------------------------------------
12596
11947
# Tests for merging the deletion of a node, where the node to be deleted
12597
11948
# is the same as or different from the node that was deleted.
14087
13417
# r8 - Text change to A/B/E/alpha
14088
13418
svntest.main.file_write(alpha_path, "New content")
14089
13419
wc_status.tweak('A/B/E/alpha', wc_rev=8)
14090
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
13420
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14091
13421
'Text change', wc_dir)
14093
13423
# r9 - Add the file A/D/H/nu and make another change to A/B/E/alpha.
14094
13424
svntest.main.file_write(alpha_path, "Even newer content")
14095
13425
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
14096
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
13426
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
14097
13427
expected_output = wc.State(wc_dir,
14098
13428
{'A/D/H/nu' : Item(verb='Adding'),
14099
13429
'A/B/E/alpha' : Item(verb='Sending')})
14100
13430
wc_status.add({'A/D/H/nu' : Item(status=' ', wc_rev=9)})
14101
13431
wc_status.tweak('A/B/E/alpha', wc_rev=9)
14102
13432
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
14103
wc_status, None, wc_dir)
14105
13435
# r10 - Merge all available revisions (i.e. -r1:9) from A to A_COPY.
14106
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
13436
svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
14108
13438
wc_status.tweak(wc_rev=9)
14109
13439
svntest.actions.run_and_verify_svn(
14111
13440
expected_merge_output([[2,9]],
14112
13441
['A ' + nu_COPY_path + '\n',
14113
13442
'U ' + alpha_COPY_path + '\n',
14409
13734
# r6: Delete 'A'
14410
13735
exit_code, out, err = svntest.actions.run_and_verify_svn(
14411
None, "(Committed revision 6.)|(\n)", [],
13736
["Committing transaction...\n",
13737
"Committed revision 6.\n"], [],
14412
13738
'delete', sbox.repo_url + '/A', '-m', 'Delete A')
14414
13740
# r7: Resurrect 'A' by copying 'A@2' to 'A'.
14415
13741
exit_code, out, err = svntest.actions.run_and_verify_svn(
14416
None, "(Committed revision 7.)|(\n)", [],
13742
["Committing transaction...\n",
13743
"Committed revision 7.\n"], [],
14417
13744
'copy', sbox.repo_url + '/A@2', sbox.repo_url + '/A',
14418
13745
'-m', 'Resurrect A from A@2')
14420
13747
# r8: Branch the resurrected 'A' to 'A_COPY'.
14421
13748
exit_code, out, err = svntest.actions.run_and_verify_svn(
14422
None, "(Committed revision 8.)|(\n)", [],
13749
["Committing transaction...\n",
13750
"Committed revision 8.\n"], [],
14423
13751
'copy', sbox.repo_url + '/A', sbox.repo_url + '/A_COPY',
14424
13752
'-m', 'Copy A to A_COPY')
14426
13754
# Update to bring all the repos side changes down.
14427
exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
13755
exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
14428
13756
'up', wc_dir)
14429
13757
wc_status.add({
14430
13758
"A_COPY/B" : Item(status=' '),
14713
14037
# r7: Merge all available revisions from A/D to A_COPY/D, this creates
14714
14038
# mergeinfo on A_COPY/D.
14715
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14716
svntest.actions.run_and_verify_svn(None,
14717
None, # Don't check stdout, we test this
14039
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
14040
svntest.actions.run_and_verify_svn(None, # Don't check stdout, we test this
14718
14041
# type of merge to death elsewhere.
14719
14042
[], 'merge', sbox.repo_url + '/A/D',
14721
14044
svntest.actions.run_and_verify_svn(
14722
None, None, [], 'ci', '-m',
14045
None, [], 'ci', '-m',
14723
14046
'Merge all available revisions from A/D to A_COPY/D', wc_dir)
14725
14048
# r8: Copy A_COPY to A_COPY_2, this carries the mergeinf on A_COPY/D
14726
14049
# to A_COPY_2/D.
14727
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14728
svntest.actions.run_and_verify_svn(None, None,[],
14050
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
14051
svntest.actions.run_and_verify_svn(None,[],
14729
14052
'copy', A_COPY_path, A_COPY_2_path)
14730
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
14053
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14731
14054
'Copy A_COPY to A_COPY_2', wc_dir)
14733
14056
# r9: Propdel the mergeinfo on A_COPY/D.
14734
svntest.actions.run_and_verify_svn(None, None,[],
14057
svntest.actions.run_and_verify_svn(None,[],
14735
14058
'pd', SVN_PROP_MERGEINFO, D_COPY_path)
14736
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
14059
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14737
14060
'Propdel the mergeinfo on A_COPY/D',
14740
14063
# r10: Merge r5 from A to A_COPY_2 so the latter gets some explicit
14742
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14743
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5',
14065
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
14066
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5',
14744
14067
sbox.repo_url + '/A', A_COPY_2_path)
14745
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
14068
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14746
14069
'Merge r5 from A to A_COPY_2', wc_dir)
14748
14071
# Now merge r9 from A_COPY to A_COPY_2. Since the merge itself cleanly
14749
14072
# removes all explicit mergeinfo from A_COPY_2/D, we should not set any
14750
14073
# mergeinfo on that subtree describing the merge.
14751
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14074
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
14752
14075
expected_output = wc.State(A_COPY_2_path, {
14753
14076
'D' : Item(status=' U'),
14836
14158
# eligible ranges to be merged to A_COPY/D/H/chi into two discrete
14837
14159
# sets: r1-4 and r5-HEAD
14838
14160
svntest.actions.run_and_verify_svn(
14840
14161
expected_merge_output([[5]],
14841
14162
['U ' + beta_COPY_path + '\n',
14842
14163
' U ' + A_COPY_path + '\n',]),
14843
14164
[], 'merge', '-c5', sbox.repo_url + '/A', A_COPY_path)
14844
svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
14165
svntest.actions.run_and_verify_svn(None, [], 'commit', '-m',
14845
14166
'Merge r5 from A to A_COPY',
14848
14169
# Update working copy to allow full inheritance and elision.
14849
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
14170
svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
14850
14171
'up', wc_dir)
14852
14173
# Merge all available revisions from A/D/H/chi to A_COPY/D/H/chi.
14853
14174
# There are no operative changes in the source, so this should
14854
14175
# not produce any output other than mergeinfo updates on
14855
14176
# A_COPY/D/H/chi. This is where the segfault occurred.
14856
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
14177
svntest.actions.run_and_verify_svn(None, [], 'merge',
14857
14178
sbox.repo_url + '/A/D/H/chi',
14858
14179
chi_COPY_path)
14859
svntest.actions.run_and_verify_svn(None,
14860
[' M ' + chi_COPY_path + '\n'],
14180
svntest.actions.run_and_verify_svn([' M ' + chi_COPY_path + '\n'],
14861
14181
[], 'st', chi_COPY_path)
14862
svntest.actions.run_and_verify_svn(None,
14863
['/A/D/H/chi:2-7\n'],
14182
svntest.actions.run_and_verify_svn(['/A/D/H/chi:2-7\n'],
14864
14183
[], 'pg', SVN_PROP_MERGEINFO,
14865
14184
chi_COPY_path)
14867
14186
#----------------------------------------------------------------------
14187
@SkipUnless(server_has_mergeinfo)
14869
14189
def copy_then_replace_via_merge(sbox):
14870
14190
"copy then replace via merge"
14985
14304
nu_COPY_path = sbox.ospath('A_COPY/C/nu')
14987
14306
# r7 - Copy the branch A_COPY@2 to A2 and update the WC.
14988
svntest.actions.run_and_verify_svn(None, None, [],
14307
svntest.actions.run_and_verify_svn(None, [],
14989
14308
'copy', A_COPY_path, A2_path)
14990
svntest.actions.run_and_verify_svn(None, None, [],
14309
svntest.actions.run_and_verify_svn(None, [],
14991
14310
'commit', '-m', 'Branch the branch',
14993
14312
# r8 - Add A/C/nu and A/B/Z.
14994
14313
# Add a new file with mergeinfo in the foreign repos.
14995
14314
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
14996
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
14997
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', Z_path)
14998
svntest.actions.run_and_verify_svn(None, None, [],
14315
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
14316
svntest.actions.run_and_verify_svn(None, [], 'mkdir', Z_path)
14317
svntest.actions.run_and_verify_svn(None, [],
14999
14318
'commit', '-m', 'Add subtrees',
15002
14321
# r9 - Edit A/C/nu and add a random property on A/B/Z.
15003
14322
svntest.main.file_write(nu_path, "New content.\n")
15004
svntest.actions.run_and_verify_svn(None, None, [],
14323
svntest.actions.run_and_verify_svn(None, [],
15005
14324
'ps', 'propname', 'propval', Z_path)
15006
svntest.actions.run_and_verify_svn(None, None, [],
14325
svntest.actions.run_and_verify_svn(None, [],
15007
14326
'commit', '-m', 'Subtree changes',
15010
14329
# r10 - Merge r8 from A to A_COPY.
15011
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
14330
svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
15013
svntest.actions.run_and_verify_svn(None,
15014
expected_merge_output(
14332
svntest.actions.run_and_verify_svn(expected_merge_output(
15016
14334
['A ' + Z_COPY_path + '\n',
15017
14335
'A ' + nu_COPY_path + '\n',
15038
14355
sbox.repo_url + '/A/D/G/rho',
15039
14356
rho_COPY_path)
15040
14357
svntest.actions.run_and_verify_svn(
15042
14358
expected_merge_output([[6]],
15043
14359
['U ' + omega_COPY_path + '\n',
15044
14360
' U ' + H_COPY_path + '\n',]),
15045
14361
[], 'merge', '-c6', sbox.repo_url + '/A/D/H', H_COPY_path)
15046
svntest.actions.run_and_verify_svn(None,
15047
expected_merge_output(
14362
svntest.actions.run_and_verify_svn(expected_merge_output(
15049
14364
['U ' + nu_COPY_path + '\n',
15050
14365
' G ' + nu_COPY_path + '\n',]),
15051
14366
[], 'merge', '-c9',
15052
14367
sbox.repo_url + '/A/C/nu',
15053
14368
nu_COPY_path)
15054
svntest.actions.run_and_verify_svn(None,
15055
expected_merge_output(
14369
svntest.actions.run_and_verify_svn(expected_merge_output(
15057
14371
[' U ' + Z_COPY_path + '\n',
15058
14372
' G ' + Z_COPY_path + '\n']),
15059
14373
[], 'merge', '-c9',
15060
14374
sbox.repo_url + '/A/B/Z',
15062
svntest.actions.run_and_verify_svn(None, None, [],
14376
svntest.actions.run_and_verify_svn(None, [],
15063
14377
'commit', '-m', 'Several subtree merges',
15066
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
14380
svntest.actions.run_and_verify_svn(exp_noop_up_out(11), [], 'up',
15069
14383
# Now do a --record-only merge of r10 and r11 from A_COPY to A2.
15739
15045
(r2_path, r2_url) = sbox.add_repo_path('fgn')
15740
15046
svntest.main.create_repos(r2_path)
15742
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
15048
svntest.actions.run_and_verify_svn(None, [], 'checkout',
15743
15049
r2_url, wc2_dir)
15745
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
15051
svntest.actions.run_and_verify_svn(None, [], 'propset',
15746
15052
'svn:eol-style', 'native',
15747
15053
sbox.ospath('iota'))
15749
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
15055
svntest.actions.run_and_verify_svn(None, [], 'cp',
15750
15056
sbox.ospath('A/D'),
15751
15057
sbox.ospath('D'))
15753
svntest.actions.run_and_verify_svn(None, None, [], 'rm',
15059
svntest.actions.run_and_verify_svn(None, [], 'rm',
15754
15060
sbox.ospath('A/D'),
15755
15061
sbox.ospath('D/G'))
15757
15063
new_file = sbox.ospath('new-file')
15758
15064
svntest.main.file_write(new_file, 'new-file')
15759
svntest.actions.run_and_verify_svn(None, None, [], 'add', new_file)
15065
svntest.actions.run_and_verify_svn(None, [], 'add', new_file)
15761
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
15067
svntest.actions.run_and_verify_svn(None, [], 'propset',
15762
15068
'svn:eol-style', 'native', new_file)
15764
svntest.actions.run_and_verify_svn(None, None, [], 'commit', wc_dir,
15070
svntest.actions.run_and_verify_svn(None, [], 'commit', wc_dir,
15765
15071
'-m', 'changed')
15767
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
15073
svntest.actions.run_and_verify_svn(None, [], 'merge',
15768
15074
sbox.repo_url, wc2_dir,
15991
15298
A_branch_path = sbox.ospath('A-branch')
15992
15299
C_branch_path = sbox.ospath('A-branch/C')
15994
# r2 - Set some intial properties:
15301
# r2 - Set some initial properties:
15996
15303
# 'dir-prop'='value1' on A/C.
15997
15304
# 'svn:eol-style'='native' on A/mu.
15998
svntest.actions.run_and_verify_svn(None, None, [],
15305
svntest.actions.run_and_verify_svn(None, [],
15999
15306
'ps', 'dir-prop', 'initial-val',
16001
svntest.actions.run_and_verify_svn(None, None, [],
15308
svntest.actions.run_and_verify_svn(None, [],
16002
15309
'ps', 'svn:eol-style', 'native',
16004
svntest.actions.run_and_verify_svn(None, None, [],
15311
svntest.actions.run_and_verify_svn(None, [],
16005
15312
'ci', '-m', 'Set some properties',
16008
15315
# r3 - Branch 'A' to 'A-branch':
16009
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16010
svntest.actions.run_and_verify_svn(None, None, [],
15316
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
15317
svntest.actions.run_and_verify_svn(None, [],
16011
15318
'copy', A_path, A_branch_path)
16012
svntest.actions.run_and_verify_svn(None, None, [],
15319
svntest.actions.run_and_verify_svn(None, [],
16013
15320
'ci', '-m', 'Create a branch of A',
16016
15323
# r4 - Make a text mod to 'A/mu' and add new props to 'A/mu' and 'A/C':
16017
15324
svntest.main.file_write(mu_path, "The new mu!\n")
16018
svntest.actions.run_and_verify_svn(None, None, [],
15325
svntest.actions.run_and_verify_svn(None, [],
16019
15326
'ps', 'prop-name', 'prop-val', mu_path)
16020
svntest.actions.run_and_verify_svn(None, None, [],
15327
svntest.actions.run_and_verify_svn(None, [],
16021
15328
'ps', 'another-dir-prop', 'initial-val',
16023
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
15330
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16024
15331
'Edit a file and make some prop changes',
16027
15334
# r5 - Modify the sole property on 'A-branch/C':
16028
svntest.actions.run_and_verify_svn(None, None, [],
15335
svntest.actions.run_and_verify_svn(None, [],
16029
15336
'ps', 'dir-prop', 'branch-val',
16030
15337
C_branch_path)
16031
svntest.actions.run_and_verify_svn(None, None, [],
15338
svntest.actions.run_and_verify_svn(None, [],
16032
15339
'ci', '-m', 'prop mod on branch', wc_dir)
16034
15341
# Now merge r4 from 'A' to 'A-branch'.
16339
15646
# r7 - Add the file A/C/nu
16340
15647
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
16341
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
16342
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15648
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
15649
svntest.actions.run_and_verify_svn(None, [], 'commit',
16343
15650
'-m', 'Add file', wc_dir)
16345
15652
# r8 - Sync merge A to A_COPY
16346
15653
svntest.actions.run_and_verify_svn(
16347
"Synch merge failed unexpectedly",
16348
15654
svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16350
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15656
svntest.actions.run_and_verify_svn(None, [], 'commit',
16351
15657
'-m', 'Sync A_COPY with A', wc_dir)
16353
15659
# r9 - Add the subtree A/D/J
16355
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', J_path)
15661
svntest.actions.run_and_verify_svn(None, [], 'mkdir', J_path)
16356
15662
svntest.main.file_write(zeta_path, "This is the file 'zeta'.\n")
16357
svntest.actions.run_and_verify_svn(None, None, [], 'add', zeta_path)
16358
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15663
svntest.actions.run_and_verify_svn(None, [], 'add', zeta_path)
15664
svntest.actions.run_and_verify_svn(None, [], 'commit',
16359
15665
'-m', 'Add subtree', wc_dir)
16361
15667
# Update the WC in preparation for merges.
16362
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
15668
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16364
15670
# r10 - Sync merge A to A_COPY
16365
15671
svntest.actions.run_and_verify_svn(
16366
"Synch merge failed unexpectedly",
16367
15672
svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16369
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15674
svntest.actions.run_and_verify_svn(None, [], 'commit',
16370
15675
'-m', 'Sync A_COPY with A', wc_dir)
16372
15677
# r11 - Text changes to A/C/nu and A/D/J/zeta.
16373
15678
svntest.main.file_write(nu_path, "This is the EDITED file 'nu'.\n")
16374
15679
svntest.main.file_write(zeta_path, "This is the EDITED file 'zeta'.\n")
16375
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15680
svntest.actions.run_and_verify_svn(None, [], 'commit',
16376
15681
'-m', 'Edit added files', wc_dir)
16378
15683
# Update the WC in preparation for merges.
16379
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
15684
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16381
15686
# This test is marked as XFail because the following two merges
16382
15687
# create mergeinfo with both non-existent path-revs and self-referential
16471
15774
# r7 - Add the file A/C/nu
16472
15775
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
16473
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
16474
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15776
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
15777
svntest.actions.run_and_verify_svn(None, [], 'commit',
16475
15778
'-m', 'Add file', wc_dir)
16477
15780
# r8 Merge c7 from A to A_COPY.
16478
15781
svntest.actions.run_and_verify_svn(
16479
"Merge failed unexpectedly",
16480
15782
svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16481
15783
A_COPY_path, '-c7')
16482
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15784
svntest.actions.run_and_verify_svn(None, [], 'commit',
16483
15785
'-m', 'Merge subtree file addition',
16486
15788
# r9 - A text change to A/C/nu.
16487
15789
svntest.main.file_write(nu_path, "This is the EDITED file 'nu'.\n")
16488
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
15790
svntest.actions.run_and_verify_svn(None, [], 'commit',
16489
15791
'-m', 'Edit added file', wc_dir)
16491
15793
# Update the WC in preparation for merges.
16492
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
15794
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16494
15796
# Now do two merges. The first, r3 to the root of the branch A_COPY.
16495
15797
# This creates working mergeinfo '/A:3,7' on A_COPY. Then do a subtree
16794
16090
# r8 - Add the file A_COPY/C/nu.
16795
16091
svntest.main.file_write(nu_COPY_path, "This is the file 'nu'.\n")
16796
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_COPY_path)
16797
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16092
svntest.actions.run_and_verify_svn(None, [], 'add', nu_COPY_path)
16093
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16798
16094
'Add a file on the A_COPY branch',
16801
16097
# r9 - Cherry pick r8 from A_COPY to A.
16802
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16803
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
16098
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16099
svntest.actions.run_and_verify_svn(None, [], 'merge',
16804
16100
sbox.repo_url + '/A_COPY',
16805
16101
A_path, '-c8')
16806
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16102
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16807
16103
'Merge r8 from A_COPY to A', wc_dir)
16809
16105
# r10 - Make a modification to A_COPY/C/nu
16810
16106
svntest.main.file_append(nu_COPY_path,
16811
16107
"More work on the A_COPY branch.\n")
16812
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16108
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16813
16109
'Some work on the A_COPY branch', wc_dir)
16815
16111
# r9 - Cherry pick r10 from A_COPY/C/nu to A/C/nu. Make some
16816
16112
# changes to A/C/nu before committing the merge.
16817
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
16113
svntest.actions.run_and_verify_svn(None, [], 'merge',
16818
16114
sbox.repo_url + '/A_COPY/C/nu',
16819
16115
nu_path, '-c10')
16820
16116
svntest.main.file_append(nu_path, "A faux conflict resolution.\n")
16821
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16117
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16822
16118
'Merge r8 from A_COPY to A', wc_dir)
16824
16120
# Sync merge A to A_COPY_2
16825
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16121
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16826
16122
expected_output = wc.State(A_COPY2_path, {
16827
16123
'B/E/beta' : Item(status='U '),
16828
16124
'C/nu' : Item(status='A '),
16922
16217
H_COPY_path = sbox.ospath('A_COPY/D/H')
16924
16219
# r7 - Delete A\D\H\chi
16925
svntest.actions.run_and_verify_svn(None, None, [], 'delete', chi_path)
16926
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16220
svntest.actions.run_and_verify_svn(None, [], 'delete', chi_path)
16221
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16927
16222
'Delete a file', wc_dir)
16929
16224
# r8 - Merge r7 from A to A_COPY
16930
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
16225
svntest.actions.run_and_verify_svn(None, [], 'merge',
16931
16226
sbox.repo_url + '/A',
16932
16227
A_COPY_path, '-c7')
16933
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16228
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16934
16229
'Cherry-pick r7 from A to A_COPY', wc_dir)
16936
16231
# r9 - File depth sync merge from A/D/H to A_COPY/D/H/
16937
16232
# This shallow merge does not create non-inheritable mergeinfo because of
16938
16233
# the issue #4057 fix; all subtrees affected by the diff are present, so
16939
16234
# non-inheritable mergeinfo is not required.
16940
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16941
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
16235
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16236
svntest.actions.run_and_verify_svn(None, [], 'merge',
16942
16237
sbox.repo_url + '/A/D/H',
16943
16238
H_COPY_path, '--depth', 'files')
16944
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16239
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16945
16240
'Cherry-pick r7 from A to A_COPY', wc_dir)
16947
16242
# Reverse merge r7 from A to A_COPY
17057
16351
H_branch_path = sbox.ospath('branch/D/H')
17059
16353
# r2 - Set svn:eol-style native on A/D/H/psi
17060
svntest.actions.run_and_verify_svn(None, None, [], 'ps', 'svn:eol-style',
16354
svntest.actions.run_and_verify_svn(None, [], 'ps', 'svn:eol-style',
17061
16355
'native', psi_path)
17062
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16356
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17063
16357
'Set eol-style native on a path',
17066
16360
# r3 - Branch ^/A to ^/branch
17067
svntest.actions.run_and_verify_svn(None, None, [], 'copy',
16361
svntest.actions.run_and_verify_svn(None, [], 'copy',
17068
16362
sbox.repo_url + '/A',
17069
16363
sbox.repo_url + '/branch',
17070
16364
'-m', 'Copy ^/A to ^/branch')
17071
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16365
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17073
16367
# r4 - Delete A/D/H/psi
17074
svntest.actions.run_and_verify_svn(None, None, [], 'delete', psi_path)
17075
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
16368
svntest.actions.run_and_verify_svn(None, [], 'delete', psi_path)
16369
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17076
16370
'Delete a a path with native eol-style',
17197
16490
expected_disk,
17198
16491
expected_status,
17199
16492
expected_skip,
17200
None, None, None, None,
17203
#----------------------------------------------------------------------
17204
# Setup helper for issue #4056 and issue #4057 tests.
17205
def noninheritable_mergeinfo_test_set_up(sbox):
17206
'''Starting with standard greek tree, copy 'A' to 'branch' in r2 and
17207
then made a file edit to A/B/lambda in r3.
17208
Return (expected_output, expected_mergeinfo_output, expected_elision_output,
17209
expected_status, expected_disk, expected_skip) for a merge of
17210
r3 from ^/A/B to branch/B.'''
17213
wc_dir = sbox.wc_dir
17215
lambda_path = sbox.ospath('A/B/lambda')
17216
B_branch_path = sbox.ospath('branch/B')
17218
# r2 - Branch ^/A to ^/branch.
17219
svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A',
17220
sbox.repo_url + '/branch', '-m', 'make a branch')
17222
# r3 - Make an edit to A/B/lambda.
17223
svntest.main.file_write(lambda_path, "trunk edit.\n")
17224
svntest.main.run_svn(None, 'commit', '-m', 'file edit', wc_dir)
17225
svntest.main.run_svn(None, 'up', wc_dir)
17227
expected_output = wc.State(B_branch_path, {
17228
'lambda' : Item(status='U '),
17230
expected_mergeinfo_output = wc.State(B_branch_path, {
17231
'' : Item(status=' U'),
17232
'lambda' : Item(status=' U'),
17234
expected_elision_output = wc.State(B_branch_path, {
17235
'lambda' : Item(status=' U'),
17237
expected_status = wc.State(B_branch_path, {
17238
'' : Item(status=' M'),
17239
'lambda' : Item(status='M '),
17240
'E' : Item(status=' '),
17241
'E/alpha' : Item(status=' '),
17242
'E/beta' : Item(status=' '),
17243
'F' : Item(status=' '),
17245
expected_status.tweak(wc_rev='3')
17246
expected_disk = wc.State('', {
17247
'' : Item(props={SVN_PROP_MERGEINFO : '/A/B:3'}),
17248
'lambda' : Item("trunk edit.\n"),
17250
'E/alpha' : Item("This is the file 'alpha'.\n"),
17251
'E/beta' : Item("This is the file 'beta'.\n"),
17254
expected_skip = wc.State(B_branch_path, {})
17256
return expected_output, expected_mergeinfo_output, expected_elision_output, \
17257
expected_status, expected_disk, expected_skip
17260
16496
#----------------------------------------------------------------------
17594
16827
wc_disk, wc_status = set_up_branch(sbox)
17596
16829
# r7 - Rename ^/A to ^/trunk.
17597
svntest.actions.run_and_verify_svn(None,
17598
['\n', 'Committed revision 7.\n'],
16830
svntest.actions.run_and_verify_svn(['Committing transaction...\n',
16831
'Committed revision 7.\n'],
17600
16833
sbox.repo_url + '/A',
17601
16834
sbox.repo_url + '/trunk',
17602
16835
'-m', "Rename 'A' to 'trunk'")
17603
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16836
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17605
16838
# r8 - Make and edit to trunk/D/H/omega (which was also edited in r6).
17606
16839
svntest.main.file_write(omega_path, "Edit 'omega' on trunk.\n")
17607
svntest.main.run_svn(None, 'ci', '-m', 'Another omega edit', wc_dir)
16840
sbox.simple_commit(message='Another omega edit')
17609
16842
# r9 - Sync merge ^/trunk to A_COPY.
17610
svntest.actions.run_and_verify_svn(None,
17611
None, # Don't check stdout, we test this
16843
svntest.actions.run_and_verify_svn(None, # Don't check stdout, we test this
17612
16844
# type of merge to death elsewhere.
17613
16845
[], 'merge', sbox.repo_url + '/trunk',
17615
svntest.main.run_svn(None, 'ci', '-m', 'Sync A_COPY with ^/trunk', wc_dir)
17616
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16847
sbox.simple_commit(message='Sync A_COPY with ^/trunk')
16848
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17618
16850
# Reverse merge -r9:1 from ^/trunk to A_COPY. This should return
17619
16851
# A_COPY to the same state it had prior to the sync merge in r2.
17752
16983
wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=2)
17754
16985
# r8 - Add a subtree under A.
17755
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', '--parents',
16986
svntest.actions.run_and_verify_svn(None, [], 'mkdir', '--parents',
17757
16988
svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
17758
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
17759
svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
16989
svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
16990
svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17760
16991
'-m', 'Add a subtree on our "trunk"')
17762
16993
# r9 - Sync ^/A to the first branch A_COPY.
17763
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17764
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
16994
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16995
svntest.actions.run_and_verify_svn(None, [], 'merge',
17765
16996
sbox.repo_url + '/A', A_COPY_path)
17766
svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
16997
svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17767
16998
'-m', 'Sync ^/A to ^/A_COPY')
17769
17000
# r10 - Make some edits on the first branch.
17770
svntest.actions.run_and_verify_svn(None, None, [], 'ps', 'branch-prop-foo',
17001
svntest.actions.run_and_verify_svn(None, [], 'ps', 'branch-prop-foo',
17771
17002
'bar', Y_COPY_path)
17772
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', W_COPY_path)
17773
svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
17003
svntest.actions.run_and_verify_svn(None, [], 'mkdir', W_COPY_path)
17004
svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17774
17005
'-m', 'Make some edits on "branch 1"')
17776
17007
# r11 - Cherry-pick r10 on the first branch back to A, but
17777
17008
# do so at depth=empty so non-inheritable mergeinfo is created.
17778
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17779
svntest.actions.run_and_verify_svn(None, None, [],
17009
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17010
svntest.actions.run_and_verify_svn(None, [],
17780
17011
'merge', '-c10', '--depth=empty',
17781
17012
sbox.repo_url + '/A_COPY/C/X/Y', Y_path)
17782
17013
svntest.actions.run_and_verify_svn(
17783
None, None, [], 'ci', wc_dir,
17014
None, [], 'ci', wc_dir,
17784
17015
'-m', 'Depth empty subtree cherry pick from "branch 1" to "trunk"')
17786
17017
# Sync ^/A to the second branch A_COPY_2.
17923
17153
wc_disk, wc_status = set_up_branch(sbox)
17925
17155
svntest.main.file_write(mu_COPY_path, "branch edit")
17926
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
17156
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17927
17157
'file edit on the branch', wc_dir)
17928
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17158
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17930
17160
# Create a file external under 'A' and set some bogus mergeinfo
17931
17161
# on it (the fact that this mergeinfo is bogus has no bearing on
17932
17162
# this test).
17933
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
17163
svntest.actions.run_and_verify_svn(None, [], 'propset',
17934
17164
'svn:externals',
17935
17165
'^/iota file-external', A_path)
17936
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
17166
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17937
17167
'set file external', wc_dir)
17938
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17939
svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
17168
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17169
svntest.actions.run_and_verify_svn(None, [], 'ps', SVN_PROP_MERGEINFO,
17940
17170
"/bogus-mergeinfo:5", file_external_path)
17941
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
17171
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17942
17172
'set mergeinfo on file external',
17943
17173
file_external_path)
17945
17175
# Sync merge ^/A to A_COPY and then reintegrate A_COPY back to A.
17946
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
17176
svntest.actions.run_and_verify_svn(None, [], 'merge',
17947
17177
sbox.repo_url + '/A', A_COPY_path)
17948
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
17178
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17949
17179
'sync merge', wc_dir)
17950
17180
# This was segfaulting, see
17951
17181
# http://svn.haxx.se/dev/archive-2012-10/0364.shtml
17952
17182
svntest.actions.run_and_verify_svn(
17954
17183
expected_merge_output(None,
17955
17184
['U ' + mu_path + '\n',
17956
17185
' U ' + A_path + '\n'],