Index: subversion/tests/cmdline/merge_symmetric_tests.py =================================================================== --- subversion/tests/cmdline/merge_symmetric_tests.py (revision 1343721) +++ subversion/tests/cmdline/merge_symmetric_tests.py (working copy) @@ -46,6 +46,7 @@ from merge_tests import local_path from merge_tests import expected_merge_output from merge_tests import svn_merge +from merge_tests import set_up_branch #---------------------------------------------------------------------- @@ -737,6 +738,94 @@ expect_mi=[7, 8, 9], expect_3ways=[three_way_merge('A8', 'A9')]) +#---------------------------------------------------------------------- +# Symmetric merges ignore subtree mergeinfo during reintegrate. +@SkipUnless(server_has_mergeinfo) +def reintegrate_ignores_subtree_mergeinfo(sbox): + "reintegrate ignores source subtree mergeinfo" + + # Some paths we'll care about. + A_COPY_gamma_path = sbox.ospath('A_COPY/D/gamma') + psi_path = sbox.ospath('A/D/H/psi') + A_COPY_D_path = sbox.ospath('A_COPY/D') + A_path = sbox.ospath('A') + + sbox.build() + wc_dir = sbox.wc_dir + + # Setup a simple 'trunk & branch': Copy ^/A to ^/A_COPY in r2 and then + # make a few edits under A in r3-6: + wc_disk, wc_status = set_up_branch(sbox) + + # r7 - Edit a file on the branch. + svntest.main.file_write(A_COPY_gamma_path, "Branch edit to 'gamma'.\n") + svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir, + '-m', 'Edit a file on our branch') + + # r8 - Do a subtree sync merge from ^/A/D to A_COPY/D. + # Note that among other things this changes A_COPY/D/H/psi. + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) + svntest.actions.run_and_verify_svn(None, None, [], 'merge', '--symmetric', + sbox.repo_url + '/A/D', A_COPY_D_path) + + # r9 - Make an edit to A/D/H/psi. + svntest.main.file_write(psi_path, "Trunk Edit to 'psi'.\n") + svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir, + '-m', 'Edit a file on our trunk') + + # Now reintegrate ^/A_COPY back to A. To the symmetric merge code the + # subtree merge to A_COPY/D just looks like any othe branch edit, it is + # not considered a merge. So the changes which exist on A/D and were + # merged to A_COPY/D, are merged *back* to A, resulting in a conflict: + # + # C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\ + # working_copies\merge_symmetric_tests-18>svn merge ^^/A_COPY A + # --symmetric + # DBG: merge.c:11461: base on source: file:///C:/SVN/src-trunk/Debug/ + # subversion/tests/cmdline/svn-test-work/repositories/ + # merge_symmetric_tests-18/A@1 + # DBG: merge.c:11462: base on target: file:///C:/SVN/src-trunk/Debug/ + # subversion/tests/cmdline/svn-test-work/repositories/ + # merge_symmetric_tests-18/A@1 + # DBG: merge.c:11567: yca file:///C:/SVN/src-trunk/Debug/subversion/ + # tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/A@1 + # DBG: merge.c:11568: base file:///C:/SVN/src-trunk/Debug/subversion/ + # tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/A@1 + # DBG: merge.c:11571: right file:///C:/SVN/src-trunk/Debug/subversion/ + # tests/cmdline/svn-test-work/repositories/merge_symmetric_tests-18/ + # A_COPY@8 + # Conflict discovered in file 'A\D\H\psi'. + # Select: (p) postpone, (df) diff-full, (e) edit, + # (mc) mine-conflict, (tc) theirs-conflict, + # (s) show all options: p + # --- Merging r2 through r8 into 'A': + # C A\D\H\psi + # U A\D\gamma + # --- Recording mergeinfo for merge of r2 through r8 into 'A': + # U A + # Summary of conflicts: + # Text conflicts: 1 + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) + exit_code, out, err = svntest.actions.run_and_verify_svn( + None, [], svntest.verify.AnyOutput, + 'merge', '--reintegrate', sbox.repo_url + '/A_COPY', A_path) + + # Not claiming this is perfect, but it's what --reintegrate has provided + # us up until now: + svntest.verify.verify_outputs("Symmetric Reintegrate failed, but not " + "in the way expected", + err, None, + "(svn: E195016: Reintegrate can only be used if " + "revisions 2 through 8 were previously " + "merged from .*/A to the reintegrate source, " + "but this is not the case:\n)" + "|( A_COPY\n)" + "|( Missing ranges: /A:5\n)" + "|(\n)" + "|(.*apr_err.*)", # In case of debug build + None, + True) # Match *all* lines of stdout + ######################################################################## # Run the tests @@ -760,6 +849,7 @@ cherry1_fwd, cherry2_fwd, cherry3_fwd, + reintegrate_ignores_subtree_mergeinfo, ] if __name__ == '__main__':