hgbook
annotate en/examples/hook.simple.pretxncommit.out @ 144:006bbad1f190
Add expected output files.
This makes it possible to spot changes in Mercurial's output and
behaviour over time.
This makes it possible to spot changes in Mercurial's output and
behaviour over time.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue Mar 06 21:44:56 2007 -0800 (2007-03-06) |
parents | |
children | 00f69e8825c5 |
rev | line source |
---|---|
bos@144 | 1 $ \textbf{cat check_bug_id} |
bos@144 | 2 #!/bin/sh |
bos@144 | 3 # check that a commit comment mentions a numeric bug id |
bos@144 | 4 hg log -r $1 --template \{desc\} | grep -q "\textbackslash{}<bug *[0-9]" |
bos@144 | 5 $ \textbf{echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc} |
bos@144 | 6 $ \textbf{echo a >> a} |
bos@144 | 7 $ \textbf{hg commit -m 'i am not mentioning a bug id'} |
bos@144 | 8 abort: pretxncommit.bug_id_required hook exited with status 1 |
bos@144 | 9 transaction abort! |
bos@144 | 10 rollback completed |
bos@144 | 11 $ \textbf{hg commit -m 'i refer you to bug 666'} |
bos@144 | 12 committed |
bos@144 | 13 |