2

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?

Tim Raynor
  • 733
  • 2
  • 12
  • 28

1 Answers1

8

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.

Kevin
  • 28,963
  • 9
  • 62
  • 81
  • This is exactly what I needed to get the branch name from the result of `hg log --rev`, which does not show the branch name by default. It appears that under the hood the branch name is in scope and can be used in a template. Cool! – Keenan Diggs Jan 10 '19 at 17:48