Mercurial > hgbook
comparison es/examples/hook.simple @ 432:04c08ad7e92e
Translated svgs dummy .tex towards building
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Sat, 18 Oct 2008 07:48:21 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
431:d13a05515acf | 432:04c08ad7e92e |
---|---|
1 #!/bin/bash | |
2 | |
3 #$ name: init | |
4 | |
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' | |
13 | |
14 #$ name: ext | |
15 #$ ignore: ^date of commit.* | |
16 | |
17 echo 'commit.when = echo -n "date of commit: "; date' >> .hg/hgrc | |
18 echo a >> a | |
19 hg commit -m 'i have two hooks' | |
20 | |
21 #$ name: | |
22 | |
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 | |
27 | |
28 #$ name: pretxncommit | |
29 | |
30 cat check_bug_id | |
31 | |
32 echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc | |
33 | |
34 echo a >> a | |
35 hg commit -m 'i am not mentioning a bug id' | |
36 | |
37 hg commit -m 'i refer you to bug 666' |