hgbook

annotate en/examples/hook.simple @ 86:796738d75876

Reduce verbosity.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed Oct 04 15:29:19 2006 -0700 (2006-10-04)
parents 5cee64874312
children ceaca14e49f0
rev   line source
bos@47 1 #!/bin/bash
bos@47 2
bos@34 3 #$ name: init
bos@34 4
bos@34 5 hg init hook-test
bos@34 6 cd hook-test
bos@34 7 echo '[hooks]' >> .hg/hgrc
bos@34 8 echo 'commit = echo committed $HG_NODE' >> .hg/hgrc
bos@34 9 cat .hg/hgrc
bos@34 10 echo a > a
bos@34 11 hg add a
bos@34 12 hg commit -m 'testing commit hook'
bos@34 13
bos@34 14 #$ name: ext
bos@34 15
bos@34 16 echo 'commit.when = echo "date of commit:"; date' >> .hg/hgrc
bos@34 17 echo a >> a
bos@34 18 hg commit -m 'i have two hooks'
bos@34 19
bos@34 20 #$ name:
bos@34 21
bos@34 22 echo '#!/bin/sh' >> check_bug_id
bos@34 23 echo '# check that a commit comment mentions a numeric bug id' >> check_bug_id
bos@34 24 echo 'hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"' >> check_bug_id
bos@34 25 chmod +x check_bug_id
bos@34 26
bos@34 27 #$ name: pretxncommit
bos@34 28
bos@34 29 cat check_bug_id
bos@34 30
bos@34 31 echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc
bos@34 32
bos@34 33 echo a >> a
bos@34 34 hg commit -m 'i am not mentioning a bug id'
bos@34 35
bos@34 36 hg commit -m 'i refer you to bug 666'