hgbook

diff ja/examples/hook.simple.pretxncommit.out @ 709:f9f71850ae1a

Merge with foozy
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Aug 14 12:10:47 2009 -0700 (2009-08-14)
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	Fri Aug 14 12:10:47 2009 -0700
     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 +