10

I working on a release so I need to specify a list of checked in tasks between two revisions of a branch.

This would work on the default branch hg log -r x:y

But I am not on the default branch, and I cannot find the syntax for specify a branch AND query for checked in between two revisions with hg log.

I think I am missing the obvious here but I don't know where.

largotiticaca
  • 383
  • 1
  • 4
  • 13
  • That command should show all changesets on all branches, not just default. You may be looking for the `-b` option to specify the branch: `hg log -r x:y -b mybranch` – Reinstate Monica -- notmaynard Oct 28 '13 at 16:42
  • My other question to follow up is, why doesn't this work: hg log -r x::y "branch(mybranch) . Mercurial returns no results at all, but no error either. – largotiticaca Oct 28 '13 at 20:36
  • What doesn't work? Do you mean, why does `hg log -r x:y` show the changesets from all branches even if you're on a specific one? – Reinstate Monica -- notmaynard Oct 28 '13 at 20:38
  • possible duplicate of [How to compare sets of changesets between 2 Mercurial branches?](http://stackoverflow.com/questions/4522974/how-to-compare-sets-of-changesets-between-2-mercurial-branches) – jmuc May 06 '15 at 08:04

1 Answers1

11

Use revsets, e.g. like so:

hg log -r "x:y and branch('mybranch')"

This should list all commits (numerically) between x and y that are also colored 'mybranch'.

If you prefer topological range (this is what most people understand with the term "branch") instead of simple numerical range, use '::' instead of ':', but check for order of x and y ( x < y ).

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Face
  • 511
  • 3
  • 5
  • okay, this answered my question. My syntax using revsets was wrong. I needed to use 'and' to specify a branch. Namely if I wanted to only get bug fixes I would also do hg log -r "x::y and branch('mybranch') and keyword('FIX')". Thanks so much everyone for your help! – largotiticaca Oct 28 '13 at 20:50
  • one caveat is that log -r x:y includes x log of x which does not follow the semantics of diff, or git log for comparison. While it seems trivial, it makes scripting with the output much harder. Sigh... – Catskul Apr 19 '17 at 21:16