Mercurial get branch name by changeset

2.2k views Asked by At

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

There are 1 answers

1
Kevin On BEST ANSWER

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.