hgbook
diff ja/examples/hook.simple.pretxncommit.out @ 1112:7764de86d22f
refined chap 2
author | Zhaoping Sun <zhaopingsun@gmail.com> |
---|---|
date | Mon Dec 28 22:58:53 2009 -0500 (2009-12-28) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ja/examples/hook.simple.pretxncommit.out Mon Dec 28 22:58:53 2009 -0500 1.3 @@ -0,0 +1,13 @@ 1.4 +$ \textbf{cat check_bug_id} 1.5 +#!/bin/sh 1.6 +# check that a commit comment mentions a numeric bug id 1.7 +hg log -r $1 --template \{desc\} | grep -q "\textbackslash{}<bug *[0-9]" 1.8 +$ \textbf{echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc} 1.9 +$ \textbf{echo a >> a} 1.10 +$ \textbf{hg commit -m 'i am not mentioning a bug id'} 1.11 +transaction abort! 1.12 +rollback completed 1.13 +abort: pretxncommit.bug_id_required hook exited with status 1 1.14 +$ \textbf{hg commit -m 'i refer you to bug 666'} 1.15 +committed 1.16 +