Mercurial > hgbook
diff en/ch09-hook.xml @ 821:88828b784971
Add more complex example hook
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 28 Apr 2009 23:10:43 -0700 |
parents | ef53d025f410 |
children | 477d6a3e5023 |
line wrap: on
line diff
--- a/en/ch09-hook.xml Tue Apr 28 22:49:50 2009 -0700 +++ b/en/ch09-hook.xml Tue Apr 28 23:10:43 2009 -0700 @@ -556,7 +556,7 @@ role="hg-cmd">hg commit</command> again. </para> -&interaction.hook.ws.simple; + &interaction.ch09-hook.ws.simple; <para id="x_235">In this example, we introduce a simple <literal role="hook">pretxncommit</literal> hook that checks for @@ -569,6 +569,8 @@ trailing whitespace cause problems. </para> + &ch09-check_whitespace.py.lst; + <para id="x_236">The above version is much more complex, but also more useful. It parses a unified diff to see if any lines add trailing whitespace, and prints the name of the file and the @@ -581,7 +583,7 @@ the saved commit message once you've corrected the problem. </para> -&interaction.hook.ws.better; + &interaction.ch09-hook.ws.better; <para id="x_237">As a final aside, note in the example above the use of <command>perl</command>'s in-place editing feature to get rid