hgbook

diff en/examples/hook.ws @ 70:365b41b6a15e

bash is not necessarily in /bin.
Original patch against an earlier rev from Guy Brand <gb@isis.u-strasbg.fr>.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Aug 08 14:13:28 2006 -0700 (2006-08-08)
parents 6f37e6a7d8cd
children ec1f144968de
line diff
     1.1 --- a/en/examples/hook.ws	Sun Jul 23 23:38:41 2006 -0700
     1.2 +++ b/en/examples/hook.ws	Tue Aug 08 14:13:28 2006 -0700
     1.3 @@ -1,7 +1,5 @@
     1.4  #!/bin/bash
     1.5  
     1.6 -cp $EXAMPLE_DIR/data/check_whitespace.py .
     1.7 -
     1.8  hg init a
     1.9  cd a
    1.10  echo '[hooks]' > .hg/hgrc
    1.11 @@ -12,3 +10,19 @@
    1.12  cat .hg/hgrc
    1.13  echo 'a ' > a
    1.14  hg commit -A -m 'test with trailing whitespace'
    1.15 +echo 'a' > a
    1.16 +hg commit -A -m 'drop trailing whitespace and try again'
    1.17 +
    1.18 +#$ name:
    1.19 +
    1.20 +echo '[hooks]' > .hg/hgrc
    1.21 +echo "pretxncommit.whitespace = check_whitespace.py" >> .hg/hgrc
    1.22 +cp $EXAMPLE_DIR/data/check_whitespace.py .
    1.23 +
    1.24 +#$ name: better
    1.25 +
    1.26 +cat .hg/hgrc
    1.27 +echo 'a ' >> a
    1.28 +hg commit -A -m 'add new line with trailing whitespace'
    1.29 +perl -pi -e 's,\s+$,,' a
    1.30 +hg commit -A -m 'trimmed trailing whitespace'