Print Current Mercurial Revision Hash?

后端 未结 8 1925
无人共我
无人共我 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'.

提交回复
热议问题