hgbook

diff fr/examples/ch09/hook.ws @ 1004:0298bccbb8ee

french small corrections, gestion de révisions au lieu de gestion de sources ou gestion de versions.
author Wilk
date Sun Sep 13 14:08:00 2009 +0200 (2009-09-13)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/fr/examples/ch09/hook.ws	Sun Sep 13 14:08:00 2009 +0200
     1.3 @@ -0,0 +1,32 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +hg init a
     1.7 +cd a
     1.8 +echo '[hooks]' > .hg/hgrc
     1.9 +echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc
    1.10 +
    1.11 +#$ name: simple
    1.12 +
    1.13 +cat .hg/hgrc
    1.14 +echo 'a ' > a
    1.15 +hg commit -A -m 'test with trailing whitespace'
    1.16 +echo 'a' > a
    1.17 +hg commit -A -m 'drop trailing whitespace and try again'
    1.18 +
    1.19 +#$ name:
    1.20 +
    1.21 +echo '[hooks]' > .hg/hgrc
    1.22 +echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc
    1.23 +cp $EXAMPLE_DIR/ch09/check_whitespace.py.lst .hg/check_whitespace.py
    1.24 +chmod +x .hg/check_whitespace.py
    1.25 +
    1.26 +#$ name: better
    1.27 +
    1.28 +cat .hg/hgrc
    1.29 +echo 'a ' >> a
    1.30 +hg commit -A -m 'add new line with trailing whitespace'
    1.31 +sed -i 's, *$,,' a
    1.32 +hg commit -A -m 'trimmed trailing whitespace'
    1.33 +
    1.34 +#$ name:
    1.35 +exit 0