Try:
hg id -i
Example:
$ hg id -i
adc56745e928
hg --debug id -i
This will output the long hash, with a plus if there are uncommitted changes.
You can use --template with the parent command, I use this to get the long hash:
hg parent --template '{node}'
Summarising the answers and their responses, it seems that this is the best way to print the unique (not short form) identifier of the current version:
hg log -l 1 --template '{node}\n' -r .
hg log -l 1 --template '{node|short}\n'
See the docs, paragraphs "The basics of templating" and following.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With