[英]Get branch name from nodeid in mercurial
How can I source the branch name from node ID in Mercurial? 如何从Mercurial的节点ID中获取分支名称? I have tried
hg id nodeid
but that doesn't work 我已经尝试过
hg id nodeid
但这不起作用
But hd id nodeid
does work, provided you spell the node identifier with the -r
or --rev
option: 但是
hd id nodeid
确实可以工作,只要您使用-r
或--rev
选项拼写节点标识符--rev
:
$ hg id -r 2
db6f6e1d8715 (sidebr) tip
Note that if the branch name is default
it is suppressed, as usual. 请注意,如果分支名称是
default
名称,则照常取消显示。
To get just the branch name, and avoid suppressing the name default
, add the -b
option: 要仅获取分支名称,并避免隐藏名称
default
,请添加-b
选项:
$ hg id -b -r 1
default
Note that you can get more than one piece of information: 请注意,您可以获得多个信息:
$ hg id -i -b -n -r 1
d05b1df8b8f6 1 default
(The order is always hash, rev, branch when using these options, regardless of the order of the -i
/ --id
, -n
/ --num
, and -b
/ --branch
options. Adding -t
/ --tags
and/or -B
/ --bookmarks
adds the tags and the bookmarks in that order, again regardless of option order.) (顺序总是散,转,分支当使用这些选项,无论秩序的
-i
/ --id
, -n
/ --num
和-b
/ --branch
选择添加。 -t
/ --tags
和/或-B
/ --bookmarks
按该顺序添加标签和书签,无论选项顺序如何。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.