1555
1556
# the reintegrate target.
1557
1558
# r7 - Create the feature branch.
1558
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1559
svntest.actions.run_and_verify_svn(None, None, [],
1559
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1560
svntest.actions.run_and_verify_svn(None, [],
1560
1561
'copy', A_path, Feature_branch_path)
1561
svntest.actions.run_and_verify_svn(None, None, [],
1562
svntest.actions.run_and_verify_svn(None, [],
1562
1563
'ci', '-m', 'Make a feature branch',
1565
1566
# r8 - Make a change under 'A'.
1566
1567
svntest.main.file_write(mu_path, "New trunk content.\n")
1567
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1568
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1568
1569
"A text change under 'A'",
1571
1572
# r9 - Make a change on the feature branch.
1572
1573
svntest.main.file_write(Feature_beta_path, "New branch content.\n")
1573
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1574
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1574
1575
"A text change on the feature branch",
1577
1578
# r10 - Sync merge all changes from 'A' to the feature branch.
1578
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1579
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
1579
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1580
svntest.actions.run_and_verify_svn(None, [], 'merge',
1580
1581
sbox.repo_url + '/A',
1581
1582
Feature_branch_path)
1582
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1583
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1583
1584
"Sync merge 'A' to feature branch",
1586
1587
# r11 - Reintegrate the feature branch back to 'A'.
1587
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1588
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1588
1589
run_reintegrate(sbox.repo_url + '/A_FEATURE_BRANCH', A_path)
1589
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1590
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1590
1591
"Reintegrate feature branch back to 'A'",
1593
1594
# r12 - Do a --record-only merge from 'A' to the feature branch so we
1594
1595
# don't try to merge r11 from trunk during the next sync merge.
1595
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1596
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c11',
1596
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1597
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c11',
1597
1598
'--record-only',
1598
1599
sbox.repo_url + '/A',
1599
1600
Feature_branch_path)
1600
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1601
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1601
1602
"Sync merge 'A' to feature branch",
1604
1605
# r13 - Make another change on the feature branch.
1605
1606
svntest.main.file_write(Feature_beta_path, "Even newer branch content.\n")
1606
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1607
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1607
1608
"Different text on the feature branch",
1610
1611
# r14 - Sync merge all changes from 'A' to the feature branch in
1611
1612
# preparation for a second reintegrate from this branch.
1612
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1613
svntest.actions.run_and_verify_svn(None, None, [], 'merge',
1613
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1614
svntest.actions.run_and_verify_svn(None, [], 'merge',
1614
1615
sbox.repo_url + '/A',
1615
1616
Feature_branch_path)
1616
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1617
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1617
1618
"2nd Sync merge 'A' to feature branch",
1620
1621
# r15 - Reintegrate the feature branch back to 'A' a second time.
1621
1622
# No self-referential mergeinfo should be applied on 'A'.
1622
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1623
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1623
1624
expected_output = wc.State(A_path, {
1624
1625
#'' : Item(status=' U'), #<-- no self-referential mergeinfo applied!
1625
1626
'B/E/beta' : Item(status='U '),
1686
1687
expected_status,
1689
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1690
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1690
1691
"2nd Reintegrate feature branch back to 'A'",
1693
1694
# Demonstrate the danger of any self-referential mergeinfo on trunk.
1695
1696
# Merge all available revisions except r3 from 'A' to 'A_COPY'.
1696
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1697
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-r3:HEAD',
1697
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1698
svntest.actions.run_and_verify_svn(None, [], 'merge', '-r3:HEAD',
1698
1699
sbox.repo_url + '/A',
1700
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
1701
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1701
1702
"Merge -r3:HEAD from 'A' to 'A_COPY'",
1703
1704
# No self-referential mergeinfo should have been carried on 'A_COPY' from
1704
1705
# 'A' that would prevent the following merge from being operative.
1705
1706
svntest.actions.run_and_verify_svn(
1707
1707
expected_merge_output([[2,3],[2,16]],
1708
1708
['U ' + psi_COPY_path + '\n',
1709
1709
' U ' + A_COPY_path + '\n',]),
1736
1737
# r6 Copy A to A2 and then manually set some self-referential mergeinfo on
1738
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [],
1739
svntest.actions.run_and_verify_svn(exp_noop_up_out(5), [],
1740
svntest.actions.run_and_verify_svn(None, None, [],
1741
svntest.actions.run_and_verify_svn(None, [],
1741
1742
'copy', A_path, A2_path)
1742
1743
# /A:3 describes A2's natural history, a.k.a. it's implicit mergeinfo, so
1743
1744
# it is self-referential. Same for /A/B:4 and A2/B. Normally this is
1744
1745
# redundant but not harmful.
1745
svntest.actions.run_and_verify_svn(None, None, [],
1746
svntest.actions.run_and_verify_svn(None, [],
1746
1747
'ps', 'svn:mergeinfo', '/A:3', A2_path)
1747
svntest.actions.run_and_verify_svn(None, None, [],
1748
svntest.actions.run_and_verify_svn(None, [],
1748
1749
'ps', 'svn:mergeinfo', '/A/B:4', A2_B_path)
1749
1750
svntest.actions.run_and_verify_svn(
1750
None, None, [], 'ci', '-m',
1751
None, [], 'ci', '-m',
1751
1752
'copy A to A2 and set some self-referential mergeinfo on the latter.',
1754
1755
# r7 Copy A2 to A2.1
1755
svntest.actions.run_and_verify_svn(None, None, [],
1756
svntest.actions.run_and_verify_svn(None, [],
1756
1757
'copy', A2_path, A2_1_path)
1757
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
1758
svntest.actions.run_and_verify_svn(None, [], 'ci',
1758
1759
'-m', 'copy A2to A2.1.', wc_dir)
1760
1761
# r8 Make a change on A2.1/mu
1761
1762
svntest.main.file_write(A2_1_mu_path, 'New A2.1 stuff')
1762
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
1763
svntest.actions.run_and_verify_svn(None, [], 'ci',
1763
1764
'-m', 'Work done on the A2.1 branch.',
1766
1767
# Update to uniform revision and reintegrate A2.1 back to A2.
1767
1768
# Note that the mergeinfo on A2/B is not changed by the reintegration
1768
1769
# and so is not expected to by updated to describe the merge.
1769
svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
1770
svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
1771
1772
expected_output = wc.State(A2_path, {
1772
1773
'mu' : Item(status='U '),
1877
1878
# from A to A_COPY, but do it via subtree merges so the mergeinfo
1878
1879
# record of the merges insn't neatly reflected in the root of the
1879
1880
# branch. Commit the merge as r8.
1880
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1881
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5',
1881
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1882
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5',
1882
1883
sbox.repo_url + '/A/B',
1884
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c4',
1885
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c4',
1885
1886
sbox.repo_url + '/A/D/G/rho',
1887
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c3',
1888
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c3',
1888
1889
sbox.repo_url + '/A/D/H',
1890
svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c6',
1891
svntest.actions.run_and_verify_svn(None, [], 'merge', '-c6',
1891
1892
sbox.repo_url + '/A',
1893
svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
1894
svntest.actions.run_and_verify_svn(None, [], 'commit', '-m',
1894
1895
'Merge everything from A to A_COPY',
2025
2027
# r8 - Add a new file A_COPY_2/C/nu.
2026
2028
svntest.main.file_write(nu_COPY_2_path, "This is the file 'nu'.\n")
2027
svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_COPY_2_path)
2028
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2029
svntest.actions.run_and_verify_svn(None, [], 'add', nu_COPY_2_path)
2030
svntest.actions.run_and_verify_svn(None, [], 'ci',
2029
2031
'-m', 'Add new file in A_COPY_2 branch',
2033
2035
# r9 - Cyclic cherry pick merge r8 from A_COPY_2 back to A.
2034
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2035
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2036
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2037
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2036
2038
'merge', '-c', '8',
2037
2039
sbox.repo_url + '/A_COPY_2',
2039
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2041
svntest.actions.run_and_verify_svn(None, [], 'ci',
2040
2042
'-m', 'Merge r8 from A_COPY_2 to A.',
2043
2045
# r10 - Make an edit to A_COPY_2/C/nu.
2044
2046
svntest.main.file_write(nu_COPY_2_path, "A_COPY_2 edit to file 'nu'.\n")
2045
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2047
svntest.actions.run_and_verify_svn(None, [], 'ci',
2046
2048
'-m', 'Edit new file on A_COPY_2 branch',
2049
2051
# r11 - Cyclic subtree cherry pick merge r10 from A_COPY_2/C/nu
2050
2052
# back to A/C/nu.
2051
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2053
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2052
2054
'merge', '-c', '10',
2053
2055
sbox.repo_url + '/A_COPY_2/C/nu',
2055
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2057
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2056
2058
'Merge r8 from A_COPY_2/C/nu to A/C/nu.',
2059
2061
# r12 - Edit under A_COPY.
2060
2062
svntest.main.file_write(mu_path, "mu edits on A_COPY.\n")
2061
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2063
svntest.actions.run_and_verify_svn(None, [], 'ci',
2062
2064
'-m', 'Work on A_COPY branch.',
2065
2067
# r13 - Sync merge A to A_COPY in preparation for reintegrate.
2066
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2067
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2068
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2069
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2068
2070
'merge', sbox.repo_url + '/A', A_COPY_path)
2069
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2071
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2070
2072
'Prep for reintegrate: Sync A to A_COPY.',
2073
2075
# r14 - Reintegrate A_COPY to A.
2074
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2076
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2075
2077
run_reintegrate(sbox.repo_url + '/A_COPY', A_path)
2076
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2078
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2077
2079
'Reintegrate A_COPY to A.',
2080
2082
# r15 - Delete A_COPY.
2081
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2083
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2082
2084
'delete', A_COPY_path)
2083
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2085
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2084
2086
'Delete A_COPY branch', wc_dir)
2086
2088
# r16 - Create new A_COPY from A@HEAD=15.
2088
2090
# Update so we copy HEAD:
2089
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2090
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2091
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2092
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2091
2093
'copy', A_path, A_COPY_path)
2092
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2094
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2093
2095
'Create new A_COPY branch from A', wc_dir)
2095
2097
# r17 - Unrelated edits under both A and A_COPY.
2096
2098
svntest.main.file_write(nu_path, "Trunk work on nu.\n")
2097
2099
svntest.main.file_write(lambda_COPY_path, "lambda edit on A_COPY.\n")
2098
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2100
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2099
2101
'Unrelated edits on A and A_COPY branch.',
2102
2104
# r18 - Sync A to A_COPY in preparation for another reintegrate.
2103
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2104
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2105
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2106
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2105
2107
'merge', sbox.repo_url + '/A', A_COPY_path)
2106
svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
2108
svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2107
2109
'Prep for reintegrate: Sync A to A_COPY.',
2110
2112
# Reintegrate A_COPY back to A. We just synced A_COPY with A, so this
2111
2113
# should work. The only text change should be the change made to
2112
2114
# A_COPY/B/lambda in r17 after the new A_COPY was created.
2113
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2115
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2114
2116
expected_output = wc.State(A_path, {
2115
2117
'' : Item(status=' U'),
2116
2118
'B/lambda' : Item(status='U '),
2216
2219
# r8 - A simple text edit on the A_COPY branch.
2217
2220
svntest.main.file_write(lambda_COPY_path, "Edit on 'branch 1'.\n")
2218
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2221
svntest.actions.run_and_verify_svn(None, [], 'ci',
2219
2222
'-m', "Work on 'branch 1'.",
2222
2225
# r9 - Sync the A_COPY branch with A up the HEAD (r8). Now A_COPY
2223
2226
# differs from A only by the change made in r8 and by the mergeinfo
2224
2227
# '/A:2-8' on A_COPY which was set to describe the merge.
2225
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2226
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2228
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2229
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2227
2230
'merge', sbox.repo_url + '/A', A_COPY_path)
2228
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2231
svntest.actions.run_and_verify_svn(None, [], 'ci',
2229
2232
'-m', 'Sync A to A_COPY.',
2232
2235
# r10 - A simple text edit on our "trunk" A.
2233
2236
svntest.main.file_write(mu_path, "Edit on 'trunk'.\n")
2234
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2237
svntest.actions.run_and_verify_svn(None, [], 'ci',
2235
2238
'-m', "Work on 'trunk'",
2238
2241
# r11 - Sync the A_COPY_2 branch with A up to HEAD (r10).
2239
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2240
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
2242
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2243
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2241
2244
'merge', sbox.repo_url + '/A',
2243
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
2246
svntest.actions.run_and_verify_svn(None, [], 'ci',
2244
2247
'-m', 'Sync A to A_COPY_2.',
2247
2250
# Confirm that the mergeinfo on each branch is what we expect.
2248
svntest.actions.run_and_verify_svn(None,
2249
[A_COPY_path + ' - /A:2-8\n'],
2251
svntest.actions.run_and_verify_svn([A_COPY_path + ' - /A:2-8\n'],
2250
2252
[], 'pg', SVN_PROP_MERGEINFO,
2251
2253
'-R', A_COPY_path)
2252
svntest.actions.run_and_verify_svn(None,
2253
[A_COPY_2_path + ' - /A:3-10\n'],
2254
svntest.actions.run_and_verify_svn([A_COPY_2_path + ' - /A:3-10\n'],
2254
2255
[], 'pg', SVN_PROP_MERGEINFO,
2255
2256
'-R', A_COPY_2_path)