Extracting bare revision numbers from $ hg log (or something similar)

Alan Mackenzie acm at muc.de
Tue Aug 23 07:42:54 UTC 2016


Hello, Nathan.

On Mon, Aug 22, 2016 at 01:23:41PM -0500, Nathan Goldbaum wrote:
> Append "-T '{rev}\n'" to your use of "hg log". See "hg help templates" for
> more information about mercurial's template system.

That is a truly magnificent reply, exactly what I need!  Thank you very
much.

> On Mon, Aug 22, 2016 at 1:14 PM, Alan Mackenzie <acm at muc.de> wrote:

> > Hello, Mercurial.

> > I can get an hg log of revisions I'm interested in with a command like
> > the following:

> >     $ hg log -b default -X.hgtags -rdefault:5389

> > .  What I really want is just the revision numbers, so that I can feed
> > these through into a script.  Of course, I could extract these revision
> > numbers myself from the result of the 'hg log ...', but it strikes me
> > there surely must be an hg command I can feed the parameters

> >     -b default -X.hgtags -rdefault:5389

> > into to get a list of wanted revisions.  I haven't been able to find any
> > such command by perusing the hg man page.  Is there one?

> > If there isn't such a command, is there some other way of doing what I
> > want which is less work (including reading documentation) than writing a
> > script to extract them from the output of the log command?

> > Thanks in advance!

--
Alan Mackenzie (Nuremberg, Germany).



More information about the Mercurial mailing list