I found the following case.
$ hg init
$ echo '
> line 1
> line 2
> ' > file.txt
$ hg add file.txt
$ hg commit -m 'added'
$ echo '
> line 11
> line 2
> ' > file.txt
$ hg commit -m 'changed line 1'
$ hg update 0
$ echo '
> line 1
> line 21
> ' > file.txt
$ hg commit -m 'changed line 2'
$ hg merge 1
Result:
file.txt file merge failed!
hg diff file.txt
diff -r bc62305d407b file.txt
@@ -1,4 +1,9 @@
+<<<<<<< local
line 1
line 21
+=======
+line 11
+line 2
+>>>>>>> other
If we try the scenario described above, but with 3 lines and changes on 1 and 2 lines, the merge will be successful. So my question is, why is this happening? Is this a merge algorithm problem or something else?
source
share