有两个分支,如何找到两个分支合并的最新修订版本?是否有标准的Mercurial命令可以执行此操作?

这与How to find the common ancestor of two branches in SVN?问题相同,但对于Mercurial而不是Subversion。

我不明白为什么Lazy Badger的答案是正确的,所以我不得不作一些画图,现在我明白了:

当两个分支合并时,它们并不是真正的“合并”,但是来自一个分支的更改将集成到第二个分支中。这意味着合并提交仅属于原始分支,而不属于合并分支。这就是为什么合并修订版是祖先修订版的两个子版本之一的原因。

最好用图片看一下:

default o----o----a---b---o---o
         \         \
other     `-o---o---m---o

ancestor(default,other) == a
children(ancestor(default,other)) == (b,m)
children(ancestor(default,other)) and merge() == m

最佳答案

hg log -r "children(ancestor(default, Cleanup)) and merge()" --template "{rev}\n"

的最新合并,用于默认分支和清除分支(Tim Henigan的答案的抛光版)。

关于mercurial - 查找两个分支的最新合并点,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8067084/

10-13 07:55
查看更多