Mercurial: List all unmerged branches

点点圈 提交于 2020-01-13 09:01:16

问题


How do I list all unmerged branches?

That is, I want a list of all branches that are not closed, and their head is not merged into some other branch.


回答1:


You can use the branches command

hg branches --active

Branches are considered active if their last commit has not been merged into another branch. Closed branches won't appear in the output at all.

If you need to handle the list programmatically, and can use .NET, there is also a Mercurial .NET library that can make this easy.




回答2:


According to http://bugs.python.org/issue15917 this should work:

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

The corresponding TortoiseHg filter is

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



来源:https://stackoverflow.com/questions/26248797/mercurial-list-all-unmerged-branches

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!