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?
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.
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.
This command:
hg parent
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With