hgbook

diff es/examples/hook.ws @ 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
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/es/examples/hook.ws	Sun Dec 13 16:35:56 2009 +0900
     1.3 @@ -0,0 +1,31 @@
     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/data/check_whitespace.py .hg
    1.24 +
    1.25 +#$ name: better
    1.26 +
    1.27 +cat .hg/hgrc
    1.28 +echo 'a ' >> a
    1.29 +hg commit -A -m 'add new line with trailing whitespace'
    1.30 +sed -i 's, *$,,' a
    1.31 +hg commit -A -m 'trimmed trailing whitespace'
    1.32 +
    1.33 +#$ name:
    1.34 +exit 0