3
我发现下列情况。相邻行上的Mercurial合并冲突
$ 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
结果:
合并file.txt的失败!
汞差异file.txt的
diff -r bc62305d407b file.txt
--- a/file.txt Fri Jun 17 22:53:22 2011 +0300
+++ b/file.txt Fri Jun 17 22:53:46 2011 +0300
@@ -1,4 +1,9 @@
+<<<<<<< local
line 1
line 21
+=======
+line 11
+line 2
+>>>>>>> other
如果我们尝试出现上述情况,但有3条线路和变化都在1和2号线,合并会成功。所以,我的问题为什么这是发生?这是合并算法还是其他问题?
已故的评论道歉。 但是,对我来说,这并没有真正回答这个问题。 在提交r1中,只有第一行发生了变化,在r2中只有第二行发生了变化。 我希望hg能够_get_ this并自动将文件内容合并到: 'line 11' 'line 21' – Carsten