当用户提交变更集时,我希望显示一条消息,提及变更集已提交的分支。
示例:
$hg commit -m 'Fix bug'
Changeset committed on branch bugfix
我是否真的需要修改hg提交代码,还是更简单/更简单的方法呢?
答案 0 :(得分:8)
添加到您的存储库的.hg / hgrc:
[hooks]
commit=echo "Changeset committed on branch `hg branch`"
答案 1 :(得分:5)
# UNIX-like
[hooks]
commit=hg log -r $HG_NODE --template "Committing on branch {branch}\n"
或
# Windows
[hooks]
commit=hg log -r %HG_NODE% --template "Committing on branch {branch}\n"