hgbook

view es/examples/hook.simple @ 536:2c2850e1e9a1

more revision; reordered files on Leame.1st
author Javier Rojas <jerojasro@devnull.li>
date Sun Jan 25 21:21:59 2009 -0500 (2009-01-25)
parents
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'