hgbook

view en/examples/hook.simple @ 679:06458701453c

Fix up some links to example URLs that aren't actually real.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Apr 21 21:07:20 2009 -0700 (2009-04-21)
parents ceaca14e49f0
children
line source
1 #!/bin/bash
3 #$ name: init
5 hg init hook-test
6 cd hook-test
7 echo '[hooks]' >> .hg/hgrc
8 echo 'commit = echo committed $HG_NODE' >> .hg/hgrc
9 cat .hg/hgrc
10 echo a > a
11 hg add a
12 hg commit -m 'testing commit hook'
14 #$ name: ext
15 #$ ignore: ^date of commit.*
17 echo 'commit.when = echo -n "date of commit: "; date' >> .hg/hgrc
18 echo a >> a
19 hg commit -m 'i have two hooks'
21 #$ name:
23 echo '#!/bin/sh' >> check_bug_id
24 echo '# check that a commit comment mentions a numeric bug id' >> check_bug_id
25 echo 'hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"' >> check_bug_id
26 chmod +x check_bug_id
28 #$ name: pretxncommit
30 cat check_bug_id
32 echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc
34 echo a >> a
35 hg commit -m 'i am not mentioning a bug id'
37 hg commit -m 'i refer you to bug 666'