Mercurial: a list of all unrelated branches

How to list all unrelated branches?

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

+4
mercurial
source share
2 answers

You can use the branch command

hg branches - active

Branches are considered active if their last commit has not been merged into another branch. Closed branches will not be displayed at all.

If you need to process the list programmatically and use .NET, there is also a library

+5
source share

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

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

Matching TortoiseHg Filter

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

+4
source share

All Articles