hgbook

diff ja/examples/hook.simple.pretxncommit.out @ 985:ac738e7a6bf9

corrected one spelling mistake in fr/appA-svn.xml
author Frédéric Bouquet <youshe.jaalon@gmail.com>
date Wed Sep 09 15:15:48 2009 +0200 (2009-09-09)
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	Wed Sep 09 15:15:48 2009 +0200
     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 +