How to get all closed branches via command line in mercurial?

一个人想着一个人 提交于 2019-12-11 07:33:33

问题


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

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