hgbook-de / it / examples / hook.simple.pretxncommit.it

<!-- BEGIN hook.simple.pretxncommit -->
<screen><prompt>$</prompt> <userinput>cat controlla_bug_id</userinput>
#!/bin/sh
# controlla che un messaggio di commit contenga un identificatore numerico di bug
hg log -r $1 --template {desc} | grep -q "\&lt;bug *[0-9]"
<prompt>$</prompt> <userinput>echo 'pretxncommit.bug_id_richiesto = ./controlla_bug_id $HG_NODE' &gt;&gt; .hg/hgrc</userinput>
<prompt>$</prompt> <userinput>echo a &gt;&gt; a</userinput>
<prompt>$</prompt> <userinput>hg commit -m "Non ho menzionato alcun identificatore di bug."</userinput>
transazione abortita!
ripristino completato
fallimento: l'hook pretxncommit.bug_id_richiesto è terminato con codice di stato 1
<prompt>$</prompt> <userinput>hg commit -m "Vi rimando al bug 666."</userinput>
inserito f753cb1e1e77ea944429e1a84d8728e96b41446e
data di inserimento: Fri Jun  5 15:50:29 GMT 2009
</screen>
<!-- END hook.simple.pretxncommit -->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.