问题
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