hgbook

view en/examples/hook.ws @ 166:08a4467f4891

Try to get the bisect extension to behave.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Mar 26 22:59:43 2007 -0700 (2007-03-26)
parents 8cf40d4d9377
children e67251ac336f
line source
1 #!/bin/bash
3 hg init a
4 cd a
5 echo '[hooks]' > .hg/hgrc
6 echo "pretxncommit.whitespace = hg export tip | (! grep -qP '^\\+.*[ \\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/data/check_whitespace.py .hg
22 #$ name: better
24 cat .hg/hgrc
25 echo 'a ' >> a
26 hg commit -A -m 'add new line with trailing whitespace'
27 sed -i 's, *$,,' a
28 hg commit -A -m 'trimmed trailing whitespace'
30 #$ name:
31 exit 0