hgbook

diff it/examples/hook.simple.pretxncommit.it @ 829:f557be55e432

Validation error.
author gpiancastelli
date Sun Aug 16 21:46:44 2009 +0200 (2009-08-16)
parents
children 5bbebcdfb533
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/it/examples/hook.simple.pretxncommit.it	Sun Aug 16 21:46:44 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 "\&lt;bug *[0-9]"
     1.9 +<prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_richiesto = ./controlla_bug_id $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
    1.10 +<prompt>$</prompt> <userinput>echo a &gt;&gt; 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 -->