Mercurial:查找存在提交的所有分支
我有几个分支和一个 ID X 的提交,我希望 Mercurial 返回该提交所在的分支列表。
Mercurial 已经在每次提交中存储了有关分支的信息,但仅限于引入该提交的分支的信息。如果您将该提交合并到其他分支,提交仍将仅存储原始分支名称。
I have a few branches and a commit with ID X, I want Mercurial to return me a list of branches where that commit exists.
Mercurial already stores information about branch in every commit, but only about a branch in which that commit was introduced. If you merge that commit into some other branch, commit will still store only original branch name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你可以用这个公式得到你想要的
head()
包括所有命名分支头,所以即使分支的尖端已合并到另一个命名分支中,它仍然会与此一起列出公式。如果您只想显示分支名称,则可能需要对
hg log
命令使用--template '{branches}\n'
指令。如果每个命名分支有多个头,您最终可能会使用uniq
或类似的。编辑:描述这将做什么
如果您执行
hg log -r 'descendants(C) and head()'
,您应该得到 E、F、H 和 I。head()
,所以它出现在这个列表中I think you could get what you want with this formula
head()
includes all named branch heads, so even if the tip of a branch has been merged into another named branch, it will still be listed with this formula.If you only want to show branch names, you will probably want to use the
--template '{branches}\n'
directive for thehg log
command. If you have more than one head per named branch, you may end up usinguniq
or similar.EDIT: To describe what this will do
If you execute
hg log -r 'descendants(C) and head()'
, you should get E, F, H and I.head()
, so it shows up on this list