annotate it/examples/hook.simple.pretxncommit.it @ 976:713f0f69029a
merge with Italian, and very (few) work on ch03
author |
Romain PELISSE <belaran@gmail.com> |
date |
Fri Sep 04 16:33:35 2009 +0200 (2009-09-04) |
parents |
|
children |
719b03ea27c8 |
rev |
line source |
belaran@976
|
1 <!-- BEGIN hook.simple.pretxncommit -->
|
belaran@976
|
2 <screen><prompt>$</prompt> <userinput>cat controlla_bug_id</userinput>
|
belaran@976
|
3 #!/bin/sh
|
belaran@976
|
4 # controlla che un messaggio di commit contenga un identificatore numerico di bug
|
belaran@976
|
5 hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"
|
belaran@976
|
6 <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_richiesto = ./controlla_bug_id $HG_NODE' >> .hg/hgrc</userinput>
|
belaran@976
|
7 <prompt>$</prompt> <userinput>echo a >> a</userinput>
|
belaran@976
|
8 <prompt>$</prompt> <userinput>hg commit -m "Non ho menzionato alcun identificatore di bug."</userinput>
|
belaran@976
|
9 transazione abortita!
|
belaran@976
|
10 ripristino completato
|
belaran@976
|
11 fallimento: l'hook pretxncommit.bug_id_richiesto รจ terminato con codice di stato 1
|
belaran@976
|
12 <prompt>$</prompt> <userinput>hg commit -m "Vi rimando al bug 666."</userinput>
|
belaran@976
|
13 inserito f753cb1e1e77ea944429e1a84d8728e96b41446e
|
belaran@976
|
14 data di inserimento: Fri Jun 5 15:50:29 GMT 2009
|
belaran@976
|
15 </screen>
|
belaran@976
|
16 <!-- END hook.simple.pretxncommit -->
|