annotate en/examples/results/hook.simple.pretxncommit.out @ 609:c44d5854620b
Fix up chapter 1.
author |
Bryan O'Sullivan <bos@serpentine.com> |
date |
Tue Mar 31 22:38:30 2009 -0700 (2009-03-31) |
parents |
44d1363234d2 |
children |
4432ad34b8e5 |
rev |
line source |
bos@564
|
1 <screen><prompt>$</prompt> <userinput>cat check_bug_id</userinput>
|
bos@144
|
2 #!/bin/sh
|
bos@144
|
3 # check that a commit comment mentions a numeric bug id
|
bos@564
|
4 hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"
|
bos@564
|
5 <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc</userinput>
|
bos@564
|
6 <prompt>$</prompt> <userinput>echo a >> a</userinput>
|
bos@564
|
7 <prompt>$</prompt> <userinput>hg commit -m 'i am not mentioning a bug id'</userinput>
|
bos@144
|
8 transaction abort!
|
bos@144
|
9 rollback completed
|
bos@273
|
10 abort: pretxncommit.bug_id_required hook exited with status 1
|
bos@564
|
11 <prompt>$</prompt> <userinput>hg commit -m 'i refer you to bug 666'</userinput>
|
bos@144
|
12 committed
|
bos@144
|
13
|
bos@564
|
14 </screen>
|