hgbook
view en/examples/results/hook.simple.pretxncommit.out @ 591:b788b405e141
Replace uses of <informalfigure> with <figure>
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu Mar 26 21:07:39 2009 -0700 (2009-03-26) |
parents | 44d1363234d2 |
children | 4432ad34b8e5 |
line source
1 <screen><prompt>$</prompt> <userinput>cat check_bug_id</userinput>
2 #!/bin/sh
3 # check that a commit comment mentions a numeric bug id
4 hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"
5 <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc</userinput>
6 <prompt>$</prompt> <userinput>echo a >> a</userinput>
7 <prompt>$</prompt> <userinput>hg commit -m 'i am not mentioning a bug id'</userinput>
8 transaction abort!
9 rollback completed
10 abort: pretxncommit.bug_id_required hook exited with status 1
11 <prompt>$</prompt> <userinput>hg commit -m 'i refer you to bug 666'</userinput>
12 committed
14 </screen>