views:

331

answers:

2

Is there a better way extract the current revision hash in Mercurial than

hg log -l1|grep changeset|cut -d: -f3

?

Part of my webapp deployment script "tags" the uploaded app tarball with its unique revision hash.

+1  A: 
hg log -l 1 --template '{node|short}\n'

See the docs, paragraphs "The basics of templating" and following.

Alex Martelli
+15  A: 

Try:

hg id -i

Example:

$ hg id -i
adc56745e928
Ry4an