hgbook
view fr/examples/ch09/hook.ws @ 1020:53dfddc566d8
French: corrections in xml tags
author | André Sintzoff <andre.sintzoff@gmail.com> |
---|---|
date | Tue Dec 01 13:40:01 2009 +0100 (2009-12-01) |
parents | |
children |
line source
1 #!/bin/bash
3 hg init a
4 cd a
5 echo '[hooks]' > .hg/hgrc
6 echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc
8 #$ name: simple
10 cat .hg/hgrc
11 echo 'a ' > a
12 hg commit -A -m 'test with trailing whitespace'
13 echo 'a' > a
14 hg commit -A -m 'drop trailing whitespace and try again'
16 #$ name:
18 echo '[hooks]' > .hg/hgrc
19 echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc
20 cp $EXAMPLE_DIR/ch09/check_whitespace.py.lst .hg/check_whitespace.py
21 chmod +x .hg/check_whitespace.py
23 #$ name: better
25 cat .hg/hgrc
26 echo 'a ' >> a
27 hg commit -A -m 'add new line with trailing whitespace'
28 sed -i 's, *$,,' a
29 hg commit -A -m 'trimmed trailing whitespace'
31 #$ name:
32 exit 0