Why no "hg id --template..." ?

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Fri Mar 28 09:11:22 CDT 2008

I'd like to grab some information about working directory (revision,
last change date etc). And just spotted, that while "hg tip" is able
to provide everything, "hg id" is limited to just numeric revision id,
branches and tags. 

I know that I can write 
   hg log -r `hg id -n`
but it a) requires backticks (non-Win in particular), b) forces
two processess spawns for trivial op and c) fails with
   abort: unknown revision '188eb551b743+'!
if there is any uncommited change.

I ended up writing 
   hg log -r `hg id -n | sed s/\+//` --template "my template here"
glazed at the incredible beauty of this command and started to write
this post ;-)

PS Just in case: I want to extract some revision-based data for the build.
So it is interesting which revision is active, not what is the tip.

| Marcin Kasperski   |   Most of the bad things that can happen to
| http://mekk.waw.pl | a project are the result of miscommunication.
|                    |                    (Booch)

More information about the Mercurial mailing list