comparison ja/examples/hook.simple @ 290:b0db5adf11c1 ja_root

fork Japanese translation.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 06 Feb 2008 17:43:11 +0900
parents en/examples/hook.simple@627effec9d4e
children
comparison
equal deleted inserted replaced
289:7be02466421b 290:b0db5adf11c1
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'