Print Current Mercurial Revision Hash?

后端 未结 8 1929
无人共我
无人共我 2020-12-12 20:04

Is there a better way extract the current revision hash in Mercurial than

hg log -l1|grep changeset|cut -d: -f3

?

Part of my webapp depl

相关标签:
8条回答
  • 2020-12-12 20:46

    As others have pointed out, don't use log -l.

    Use hg log -r . to get detailed information, as opposed to using hg id whose output is limited and it does not support templates. You could also create a little alias like here = log -r . and use hg here. If you only want the hash use hg log -r . --template '{node}\n'.

    0 讨论(0)
  • 2020-12-12 20:47
    hg log -l 1 --template '{node|short}\n'
    

    See the docs, paragraphs "The basics of templating" and following.

    0 讨论(0)
提交回复
热议问题