Mercury equivalent of git HEAD ~ 1

In git, itโ€™s pretty convenient to identify the commit relative to the last commit in the repo using HEAD~1 .

I searched and cannot find an equivalent for this in mercurial. I find mercury revision numbers to be quite annoying.

+4
source share
3 answers

There is a mercury extension that adds git commands.
The specific command is hg log -pr tip^1.

For more information, see checking for changeset in hg

+5
source

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 ).

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) .

+9
source

The correct answer is .^ Or .~1 .

tip indicates the latest revision that entered the repository, not the current revision. Any answers containing tip in them are incorrect.

+5
source

All Articles