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