How can I find my working revision in mercurial

前端 未结 6 537
独厮守ぢ
独厮守ぢ 2021-02-01 12:27

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?

6条回答
  •  长发绾君心
    2021-02-01 13:03

    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.

提交回复
热议问题