Mercurial > hgbook
view en/examples/results/hook.simple.pretxncommit.out @ 750:c15e039d98b8
appB-mq-ref.xml: Typo fix
author | Dongsheng Song <dongsheng.song@gmail.com> |
---|---|
date | Fri, 20 Mar 2009 16:50:51 +0800 |
parents | 0d5935744f87 |
children | 4432ad34b8e5 |
line wrap: on
line source
<screen><prompt>$</prompt> <userinput>cat check_bug_id</userinput> #!/bin/sh # check that a commit comment mentions a numeric bug id hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]" <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc</userinput> <prompt>$</prompt> <userinput>echo a >> a</userinput> <prompt>$</prompt> <userinput>hg commit -m 'i am not mentioning a bug id'</userinput> transaction abort! rollback completed abort: pretxncommit.bug_id_required hook exited with status 1 <prompt>$</prompt> <userinput>hg commit -m 'i refer you to bug 666'</userinput> committed </screen>