0

I need to revert back to a particular revision.
For accomplishing the same, i am using the following command:

hg revert -r REV
(Reference - here)

But the problem is that even though i know the nodeid of that particular revision (the one to which i want to revert), but i do not know the revision number.

is there any way in which i could get the revision number(REV) from that nodeid?

Please help me out here - I am new to using Mercurial
Thanks in advance.

Community
  • 1
  • 1
Avijit Gupta
  • 5,676
  • 3
  • 20
  • 35

1 Answers1

4

You need hg identify to answer your question and use -n to report back the local revision id:

hg identify -n -r <hash>

To make it really simple, most hg commands take both the local id or the global hash as valid identifiers so you could just use

hg revert -r <hash> --all

My followup question is this: Why are you reverting a changeset? To change your working directory to a particular point in the history you use

hg update -r <hash>

and then continue your development from there by creating a new (unnamed) branch.

Edward
  • 3,292
  • 1
  • 27
  • 38