Find the latest merge point of two branches

后端 未结 7 2017
旧时难觅i
旧时难觅i 2021-02-01 05:16

Having two branches, how can I find the latest revision(s) where the two branches were merged? Is there a standard Mercurial command to do that?

This is the same as ques

7条回答
  •  星月不相逢
    2021-02-01 05:36

    If you have more than two branches then you have to add an additional filter to Lazy Badger's answer, because children() might give you also children that are not in your branches.

    hg log -r "children(ancestor(default, Cleanup)) and merge() and branch(default|Cleanup)" --template "{rev}\n"
    
    other     o---o-----m1---o
                       /
    default   o---o---a---b---o
                       \
    another   o---o-----m2---o
    
    ancestor(default, other) == a
    children(ancestor(default, other)) == (m1,b,m2)
    children(ancestor(default, other)) and merge() == (m1,m2)
    children(ancestor(default, other)) and merge() and branch(default, other) == m1
    

提交回复
热议问题