hgbook
view en/examples/hook.simple.pretxncommit.out @ 146:65f6f9d18fa1
Oops! I forgot that I need the undoctored output files in the book!
Now they're named "*.lxo", instead of "*.out". Ugh.
Now they're named "*.lxo", instead of "*.out". Ugh.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue Mar 06 21:55:48 2007 -0800 (2007-03-06) |
parents | |
children | 00f69e8825c5 |
line source
1 $ \textbf{cat check_bug_id}
2 #!/bin/sh
3 # check that a commit comment mentions a numeric bug id
4 hg log -r $1 --template \{desc\} | grep -q "\textbackslash{}<bug *[0-9]"
5 $ \textbf{echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc}
6 $ \textbf{echo a >> a}
7 $ \textbf{hg commit -m 'i am not mentioning a bug id'}
8 abort: pretxncommit.bug_id_required hook exited with status 1
9 transaction abort!
10 rollback completed
11 $ \textbf{hg commit -m 'i refer you to bug 666'}
12 committed