Mercurial:列出所有未合并的分支

Gil*_*ili 7 mercurial

如何列出所有未合并的分支?

也就是说,我想要一个未关闭的所有分支的列表,并且它们的头部不会合并到其他分支中.

Kin*_*ead 8

您可以使用branches命令

hg branches --active

如果分支的最后一次提交尚未合并到另一个分支,则认为它们是活动的.封闭的分支根本不会出现在输出中.

如果您需要以编程方式处理列表,并且可以使用.NET,那么还有一个可以简化这一过程的Mercurial .NET库.


Gil*_*ili 5

根据http://bugs.python.org/issue15917这应该有效:

hg log -r "head()-parents(merge())-closed()-tag(tip)" --template "{branch}\n"

对应的 TortoiseHg 过滤器是

head() and not closed() and not parents(merge()) and not tag(tip)

  • 对于正确合并的存储库,您将始终获得 `tip` 作为结果和 tip 的分支。将 `-tag(tip)` 添加到 revset (2认同)