hgbook
annotate es/examples/hook.simple @ 336:7e52f0cc4516
changed es/hgext.tex
changed es/hook.tex
changed es/kdiff3.png
changed es/license.tex
changed es/mq-collab.tex
changed es/mq-ref.tex
changed es/mq.tex
changed es/note.png
changed es/tour-merge.tex
changed es/undo-manual-merge.dot
changed es/undo-non-tip.dot
files needed to compile the pdf version of the book.
changed es/hook.tex
changed es/kdiff3.png
changed es/license.tex
changed es/mq-collab.tex
changed es/mq-ref.tex
changed es/mq.tex
changed es/note.png
changed es/tour-merge.tex
changed es/undo-manual-merge.dot
changed es/undo-non-tip.dot
files needed to compile the pdf version of the book.
author | jerojasro@localhost |
---|---|
date | Sat Oct 18 15:44:41 2008 -0500 (2008-10-18) |
parents | |
children |
rev | line source |
---|---|
igor@333 | 1 #!/bin/bash |
igor@333 | 2 |
igor@333 | 3 #$ name: init |
igor@333 | 4 |
igor@333 | 5 hg init hook-test |
igor@333 | 6 cd hook-test |
igor@333 | 7 echo '[hooks]' >> .hg/hgrc |
igor@333 | 8 echo 'commit = echo committed $HG_NODE' >> .hg/hgrc |
igor@333 | 9 cat .hg/hgrc |
igor@333 | 10 echo a > a |
igor@333 | 11 hg add a |
igor@333 | 12 hg commit -m 'testing commit hook' |
igor@333 | 13 |
igor@333 | 14 #$ name: ext |
igor@333 | 15 #$ ignore: ^date of commit.* |
igor@333 | 16 |
igor@333 | 17 echo 'commit.when = echo -n "date of commit: "; date' >> .hg/hgrc |
igor@333 | 18 echo a >> a |
igor@333 | 19 hg commit -m 'i have two hooks' |
igor@333 | 20 |
igor@333 | 21 #$ name: |
igor@333 | 22 |
igor@333 | 23 echo '#!/bin/sh' >> check_bug_id |
igor@333 | 24 echo '# check that a commit comment mentions a numeric bug id' >> check_bug_id |
igor@333 | 25 echo 'hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"' >> check_bug_id |
igor@333 | 26 chmod +x check_bug_id |
igor@333 | 27 |
igor@333 | 28 #$ name: pretxncommit |
igor@333 | 29 |
igor@333 | 30 cat check_bug_id |
igor@333 | 31 |
igor@333 | 32 echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc |
igor@333 | 33 |
igor@333 | 34 echo a >> a |
igor@333 | 35 hg commit -m 'i am not mentioning a bug id' |
igor@333 | 36 |
igor@333 | 37 hg commit -m 'i refer you to bug 666' |