Tim Raynor
Tim Raynor

Reputation: 753

Mercurial get branch name by changeset

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?

Upvotes: 2

Views: 2278

Answers (1)

Kevin
Kevin

Reputation: 30151

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.

Upvotes: 8

Related Questions