Mercurial通过更改集获取分支名称 [英] Mercurial get branch name by changeset

查看:82
本文介绍了Mercurial通过更改集获取分支名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过

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?

推荐答案

那不是...修订集的用途.您想做一些与众不同的事情:

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

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

请参见 hg help templates .

这篇关于Mercurial通过更改集获取分支名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆