Search code examples
mercurial

What is the two numbers in Mercurial changeset ID?


$ hg heads
changeset:   211:746a4ab8b3e3

What is 211 and 746a4ab8b3e3 respectively?

When I do hg revert -r REV, what should REV be? 211 or 746a4ab8b3e3, or 211:746a4ab8b3e3?


Solution

  • 211 is the local revision number and 746a4ab8b3e3 is the short Node ID. The local revision will [likely] differ between repositories for the same Node ID and is not useful to communicate revisions. The form with the : is just a way they are commonly represented together for display.

    In most cases either "revision number" is okay for use with Hg commands. (And the local version is easier to type!) Be warned, though: if someone says to "update to revision 42" then they are either looking at your screen or need to be taught a lesson.

    Now go find an Hg tutorial ;-)