hgbook

view en/examples/hook.simple @ 265:d9a1faa45c30

added a space between -m and the commit message.
author bab@draketo.de
date Fri Aug 31 11:36:14 2007 +0200 (2007-08-31)
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'