问题
In command line I can get all heads without closed branches via:
hg heads
Also I can get all heads with closed branches via:
hg heads --closed
But, how do I can know all closed branches via command line?
回答1:
RTM hg help revsets
hg log -r "closed()"
Samples:
>hg heads -T "{rev}:{node|short}\n"
9:caaade505e23
5:0c0ceaa4a8d2
3:3c58290b241d
1:99f7ad94a56f
>hg heads -c -T "{rev}:{node|short}\n"
10:fc7ddfb862bd
9:caaade505e23
5:0c0ceaa4a8d2
3:3c58290b241d
1:99f7ad94a56f
>hg log -r "closed()" -T "{rev}:{node|short}\n"
10:fc7ddfb862bd
Branch names for all closed heads (useful for named branches mostly)
hg log -r "closed()" -T "{branch}\n"
回答2:
If you are interested just for the names or md5 you can use:
hg branches --closed
来源:https://stackoverflow.com/questions/40381052/how-to-get-all-closed-branches-via-command-line-in-mercurial