Mercurial > hgbook
annotate es/examples/hook.simple @ 542:2daeda01fe98
Started mq, please do look the translation terms about push and pop on this context
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Sun, 07 Dec 2008 17:47:38 -0500 |
parents | 04c08ad7e92e |
children |
rev | line source |
---|---|
432
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
1 #!/bin/bash |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
2 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
3 #$ name: init |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
4 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
5 hg init hook-test |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
6 cd hook-test |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
7 echo '[hooks]' >> .hg/hgrc |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
8 echo 'commit = echo committed $HG_NODE' >> .hg/hgrc |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
9 cat .hg/hgrc |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
10 echo a > a |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
11 hg add a |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
12 hg commit -m 'testing commit hook' |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
13 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
14 #$ name: ext |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
15 #$ ignore: ^date of commit.* |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
16 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
17 echo 'commit.when = echo -n "date of commit: "; date' >> .hg/hgrc |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
18 echo a >> a |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
19 hg commit -m 'i have two hooks' |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
20 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
21 #$ name: |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
22 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
23 echo '#!/bin/sh' >> check_bug_id |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
24 echo '# check that a commit comment mentions a numeric bug id' >> check_bug_id |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
25 echo 'hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"' >> check_bug_id |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
26 chmod +x check_bug_id |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
27 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
28 #$ name: pretxncommit |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
29 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
30 cat check_bug_id |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
31 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
32 echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
33 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
34 echo a >> a |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
35 hg commit -m 'i am not mentioning a bug id' |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
36 |
04c08ad7e92e
Translated svgs dummy .tex towards building
Igor TAmara <igor@tamarapatino.org>
parents:
diff
changeset
|
37 hg commit -m 'i refer you to bug 666' |