In git, itโs pretty convenient to identify the commit relative to the last commit in the repo using HEAD~1 .
HEAD~1
I searched and cannot find an equivalent for this in mercurial. I find mercury revision numbers to be quite annoying.
There is a mercury extension that adds git commands.The specific command is hg log -pr tip^1.
hg log -pr tip^1.
For more information, see checking for changeset in hg
The Mercurial snooze function is extremely powerful (and much less cryptic than the git spec specification syntax): see hg help revsets (or online at: http://www.selenic.com/mercurial/hg.1.html#specifying- revision-sets ).
hg help revsets
See the list of predicates here (I donโt know why they are not displayed in the online document): http://hg.intevation.org/mercurial/crew/file/e597ef52a7c2/mercurial/revset.py#l811
In your case it will be: p1(tip) .
p1(tip)
The correct answer is .^ Or .~1 .
.^
.~1
tip indicates the latest revision that entered the repository, not the current revision. Any answers containing tip in them are incorrect.
tip