hgbook

view it/examples/hook.simple.pretxncommit.it @ 1114:527b86d55d4a

inotify: update installation information

inotify is shipped in Mercurial since 1.0, which greatly simplifies the installation process
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun Dec 13 16:35:56 2009 +0900 (2009-12-13)
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 "\&lt;bug *[0-9]"
6 <prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_richiesto = ./controlla_bug_id $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
7 <prompt>$</prompt> <userinput>echo a &gt;&gt; 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 -->