view ja/examples/hook.simple.pretxncommit.out @ 838:d1f676a6a4b3 default tip

update mq chapter. propagate ef53d025f410.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 03 Dec 2009 01:26:08 +0900
parents b0db5adf11c1
children
line wrap: on
line source

$ \textbf{cat check_bug_id}
#!/bin/sh
# check that a commit comment mentions a numeric bug id
hg log -r $1 --template \{desc\} | grep -q "\textbackslash{}<bug *[0-9]"
$ \textbf{echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc}
$ \textbf{echo a >> a}
$ \textbf{hg commit -m 'i am not mentioning a bug id'}
transaction abort!
rollback completed
abort: pretxncommit.bug_id_required hook exited with status 1
$ \textbf{hg commit -m 'i refer you to bug 666'}
committed