Search code examples
mercurial

What is the name for the commit/head that corresponds to the local checked-out state?


There is a commit in my hg repository with hash 123abc. This is the last commit I made in the repo. When I run hg diff --from 123abc, I see no output. When I run hg log --graph, I see an @ next to 123abc.

In Git this commit would be called "HEAD". I'm not sure what it's called in Mercurial. It is not the "tip", because I pulled other changes after the last time I committed (and hg log -r tip shows commit 456def).

What is this commit/head called?


Solution

  • Mercurial calls this the "parent" or the "parent revision of the working directory", and you can see it by running hg parent, hg id, or hg summary.

    You can refer to it as . with the hg log command:

    hg log -r .  # show the commit message for the parent