Encountered an unexpected text conflict while working on some 1.6.x backports.
A quick demonstration with our own repository:
# Checkout the 1.6.x-issue3242-reintegrate branch:
>svn co
https://svn.apache.org/repos/asf/subversion/branches/1.6.x-issue3242-reintegrate@955651
src-branch-1.6.x-issue3242 -q
> cd src-branch-1.6.x-issue3242
# Try to merge this revision from the 1.6.x branch...
>svn log -vq -r955343 ^^/
------------------------------------------------------------------------
r955343 | hwright | 2010-06-16 14:44:19 -0400 (Wed, 16 Jun 2010)
Changed paths:
M /subversion/branches/1.6.x
M /subversion/branches/1.6.x/CHANGES
M /subversion/branches/1.6.x/STATUS
M /subversion/branches/1.6.x/subversion/libsvn_client/merge.c
M /subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py
------------------------------------------------------------------------
# ...But first take note that the svn:eol-style on the target is native
# and that r955343 isn't applying any change to svn:eol-style property.
>svn pg svn:eol-style subversion\tests\cmdline\merge_tests.py
native
>svn pg svn:eol-style -v -r955343
^^/subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py@955342
Properties on
'https://svn.apache.org/repos/asf/subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py':
svn:eol-style
native
>svn pg svn:eol-style -v -r955343
^^/subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py@955343
Properties on
'https://svn.apache.org/repos/asf/subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py':
svn:eol-style
native
# Notice also that r955343 is simply the addtion of a new test.
# Nothing unusual there:
>svn diff -r955342:955343
^^/subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py
Index: merge_tests.py
===================================================================
--- merge_tests.py (revision 955342)
+++ merge_tests.py (revision 955343)
@@ -5320,7 +5320,8 @@
'pi' : Item("This is the file 'pi'.\n"),
'rho' : Item("New content"),
'rho_copy' : Item("New content",
- props={SVN_PROP_MERGEINFO : '/A/D/G/rho:4'}),
+ props={SVN_PROP_MERGEINFO :
+ '/A/D/G/rho:4\n/A/D/G/rho_copy:4-5'}),
'tau' : Item("This is the file 'tau'.\n"),
})
expected_skip = wc.State(G_COPY_path, { })
@@ -16397,6 +16398,194 @@
None, None, None, None,
None, 1, 0, '--reintegrate')
+#----------------------------------------------------------------------
+# Test for issue #3654 'added subtrees with mergeinfo break reintegrate'.
+def added_subtrees_with_mergeinfo_break_reintegrate(sbox):
+ "added subtrees with mergeinfo break reintegrate"
+
.
<SNIP>
.
########################################################################
# Run the tests
@@ -16620,6 +16809,7 @@
SkipUnless(handle_gaps_in_implicit_mergeinfo,
server_has_mergeinfo),
reintegrate_with_self_referential_mergeinfo,
+ added_subtrees_with_mergeinfo_break_reintegrate,
]
if __name__ == '__main__':
# Do the merge, we get a text conflict on merge_tests.py:
>svn merge -c955343 ^^/subversion/branches/1.6.x .
--- Merging r955343 into '.':
U STATUS
Conflict discovered in
'C:/SVN/src-branch-1.6.x-issue3242/subversion/tests/cmdline/merge_tests.py'.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options: p
CU subversion\tests\cmdline\merge_tests.py
U subversion\libsvn_client\merge.c
--- Merging r955343 into 'CHANGES':
G CHANGES
--- Merging r955343 into '.':
G .
--- Recording mergeinfo for merge of r955343 into '.':
G .
--- Recording mergeinfo for merge of r955343 into 'CHANGES':
G CHANGES
--- Recording mergeinfo for merge of r955343 into
'subversion\tests\cmdline\merge_tests.py':
G subversion\tests\cmdline\merge_tests.py
Summary of conflicts:
Text conflicts: 1
>svn st
M .
M STATUS
CM subversion\tests\cmdline\merge_tests.py
? subversion\tests\cmdline\merge_tests.py.merge-left.r955342
? subversion\tests\cmdline\merge_tests.py.merge-right.r955343
? subversion\tests\cmdline\merge_tests.py.working
M subversion\libsvn_client\merge.c
M CHANGES
Summary of conflicts:
Text conflicts: 1
# So what is the conflict? The whole working file is replaced
# by the right side of the merge:
>svn diff subversion\tests\cmdline\merge_tests.py
Index: subversion/tests/cmdline/merge_tests.py
===================================================================
--- subversion/tests/cmdline/merge_tests.py (revision 955651)
+++ subversion/tests/cmdline/merge_tests.py (working copy)
@@ -1,3 +1,4 @@
+<<<<<<< .working
#!/usr/bin/env python
#
# merge_tests.py: testing merge
@@ -16628,3 +16629,16825 @@
### End of file.
+=======
+#!/usr/bin/env python
+#
+# merge_tests.py: testing merge
+#
+# Subversion is a tool for revision control.
.
<SNIP>
.
+if __name__ == '__main__':
+ svntest.main.run_tests(test_list)
+ # NOTREACHED
+
+
+### End of file.
+>>>>>>> .merge-right.r955343
Property changes on: subversion\tests\cmdline\merge_tests.py
___________________________________________________________________
Added: svn:mergeinfo
Merged
/subversion/branches/svnpatch-diff/subversion/tests/cmdline/merge_tests.py:r871905,871986
.
<SNIP Mergeinfo addition>
This looks like an eol problem, but as we showed above, there are no changes to
the svn:eol-style property nor are there any eol changes in the incoming diff.
Doing a quick debug showed that when the svn_delta_editor_t close_file()
callback is called for merge_tests.py, the propchanges in the incoming
file_baton's prop changes contain a change to svn:eol-style=native. This is
obviously bogus and eventually causes
libsvn_wc/merge.c:maybe_update_target_eols() to be called, because it appears
that the diff is setting svn:eol-style to native for the first time on
merge_tests.py. The effect here is the the temp file representing the left side
of the merge is translated to native line endings, but the right side is not and
hence it looks like the whole file has been changed. I took a quick stab at
recreating this from scratch, but with no luck, so I'm dumping my thoughts so
far into this issue. Will get back to it later, but if anyone wants to have
look in the meantime, have at it.