hgbook

view en/examples/results/hook.simple.pretxncommit.out @ 611:4432ad34b8e5

Check in example outputs with begin/end markers.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Mar 31 12:19:01 2009 -0700 (2009-03-31)
parents 0d5935744f87
children
line source
1 <!-- BEGIN hook.simple.pretxncommit -->
2 <screen><prompt>$</prompt> <userinput>cat check_bug_id</userinput>
3 #!/bin/sh
4 # check that a commit comment mentions a numeric bug id
5 hg log -r $1 --template {desc} | grep -q "\&lt;bug *[0-9]"
6 <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
7 <prompt>$</prompt> <userinput>echo a &gt;&gt; a</userinput>
8 <prompt>$</prompt> <userinput>hg commit -m 'i am not mentioning a bug id'</userinput>
9 transaction abort!
10 rollback completed
11 abort: pretxncommit.bug_id_required hook exited with status 1
12 <prompt>$</prompt> <userinput>hg commit -m 'i refer you to bug 666'</userinput>
13 committed
15 </screen>
16 <!-- END hook.simple.pretxncommit -->