Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find my working revision in mercurial

Tags:

mercurial

In a mercurial repo I can run hg up {revision} to change the revision of my working directory, but what command can I run to discover what revision I'm looking at?

like image 217
Asa Ayers Avatar asked Dec 02 '10 00:12

Asa Ayers


People also ask

How does Mercurial work?

Mercurial repositories contain a working directory coupled with a store: The store contains the complete history of the project. Unlike traditional SCMs, where there's only one central copy of this history, every working directory is paired with a private copy of the history.

What is hg tip?

The tip is the changeset added to the repository most recently. If you have just made a commit, that commit will be the tip. Alternately, if you have just pulled from another repository, the tip of that repository becomes the new tip. Use hg tip to show the tip of the repository. The tip is always a head.


2 Answers

This command:

hg parent 
like image 55
zerkms Avatar answered Sep 19 '22 08:09

zerkms


In addition to hg parents, you can use hg summary to get the most important summary information about your current state. It looks like this:

% hg summary parent: 13051:120eccaaa522 tip  encoding: fix typo in variable name branch: default commit: 2 unknown (clean) update: (current) mq:     20 unapplied 

and tells me at a glance that I'm at revision 13051, that I'm on the default branch with a clean working copy (though there are 2 untracked files). This is the tip revision in my repository, so an update wont do anything. Finally, I have 20 unapplied MQ patches.

like image 41
Martin Geisler Avatar answered Sep 19 '22 08:09

Martin Geisler