Frage

Whilst merging revisions from the trunk to a branch I am looking to achieve the following:

Revision 1 (This is also the branch version):

First Line

Revision 2:

First Line
Second Line

Revision 3:

First Line
Second Line
Third Line

By executing the following command on the branch:

svn merge -c 3 [trunkurl]

I am expecting to get the following result

First Line
Third Line

But instead I am getting a tree conflict. This technique seems to work fine for adding new lines in the middle of files, just not to the end of a file.

War es hilfreich?

Lösung

You had bad and wrong expectation, but Subversion (without tree conflict, only with file conflict /tree conflict is impossible here/) raised correct error

When Subversion merge, it tries to /to some degree, real merge-algorithm is a lot more complex/ apply diffs (unified, with default context = 3, AFAIR) from source tree for affected revisions to target. If you'll try to see at diff of your HEAD, you'll see

Index: file.txt
===================================================================
--- file.txt    (revision 4)
+++ file.txt    (revision 5)
@@ -1,2 +1,3 @@
 First Line
 Second Line
+Third Line

but this context doesn't exist in branch, thus - even ordinary patch with default settings will reject this diff

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top