Mercurial get branch name by changeset

随声附和 提交于 2019-12-02 01:45:49

问题


I have tried the

hg log --rev "branch([changeset])"

but what I got is a collection of all the changesets in this branch.

What I do want to get is the name of the target branch (e.g. default) instead of the whole collection.

Is there a way to achieve this goal?


回答1:


That's... not what revsets are for. You want to do something rather different:

hg log --rev [changeset] --template "{branch}\n"

See hg help templates.



来源:https://stackoverflow.com/questions/30881351/mercurial-get-branch-name-by-changeset

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