hgbook
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/it/examples/hook.simple.pretxncommit.it Fri Sep 04 16:33:35 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +<!-- BEGIN hook.simple.pretxncommit --> 1.5 +<screen><prompt>$</prompt> <userinput>cat controlla_bug_id</userinput> 1.6 +#!/bin/sh 1.7 +# controlla che un messaggio di commit contenga un identificatore numerico di bug 1.8 +hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]" 1.9 +<prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_richiesto = ./controlla_bug_id $HG_NODE' >> .hg/hgrc</userinput> 1.10 +<prompt>$</prompt> <userinput>echo a >> a</userinput> 1.11 +<prompt>$</prompt> <userinput>hg commit -m "Non ho menzionato alcun identificatore di bug."</userinput> 1.12 +transazione abortita! 1.13 +ripristino completato 1.14 +fallimento: l'hook pretxncommit.bug_id_richiesto รจ terminato con codice di stato 1 1.15 +<prompt>$</prompt> <userinput>hg commit -m "Vi rimando al bug 666."</userinput> 1.16 +inserito f753cb1e1e77ea944429e1a84d8728e96b41446e 1.17 +data di inserimento: Fri Jun 5 15:50:29 GMT 2009 1.18 +</screen> 1.19 +<!-- END hook.simple.pretxncommit -->