没有技术上的原因说明你无法与祖先合并:正如你发现的,Mercurial在某些情况下确实支持它。所以这完全是一个GUI限制。这背后的原因是,当hg update
会给你与hg merge
相同的结果,那么你应该使用它来代替简单。
A 合并只是三种存储库状态的组合:共同祖先和两个正在合并的变更集。三方合并是在一个大块的基础上完成的。对于合并本地和远程表看起来是这样的:
ancestor local remote -> merge
old old old old (nobody changed the hunk)
old new old new (I changed the hunk)
old old new new (you changed the hunk)
old new new new (hunk was cherry picked onto both branches)
old foo bar <!> (conflict, both changed hunk but differently)
如果local
是remote
的祖先,然后ancestor == local
。因此,该表变为:
ancestor local remote -> merge
old old old old (nobody changed the hunk)
old old new new (you changed the hunk)
在这两种情况下,merge
列包含的内容是在remote
列。在你的榜样,local
是default
和remote
是file-content
:
$ hg update default
$ hg merge file-content
结果是合并变更,看起来就像file-content
。
请求发表本主题也 – 2012-03-22 13:30:03
那么在这个例子中使用了哪些命令来获取这个变更集历史?我不能在命令行重新创建它。 – Jegschemesch 2012-03-22 21:01:22