Print Current Mercurial Revision Hash?

rentzsch picture rentzsch · Mar 21, 2010 · Viewed 51.5k times · Source

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.

Answer

Ry4an Brase picture Ry4an Brase · Mar 21, 2010

Try:

hg id -i

Example:

$ hg id -i
adc56745e928