hgbook
view en/examples/hook.ws @ 68:c574ce277a2b
Mostly random attempt to see if fiddling with the child will help the parent.
Motivated by problems people are having on Debian sid and FreeBSD.
Motivated by problems people are having on Debian sid and FreeBSD.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Aug 07 15:45:08 2006 -0700 (2006-08-07) |
parents | 6f37e6a7d8cd |
children | ec1f144968de |
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 = check_whitespace.py" >> .hg/hgrc
20 cp $EXAMPLE_DIR/data/check_whitespace.py .
22 #$ name: better
24 cat .hg/hgrc
25 echo 'a ' >> a
26 hg commit -A -m 'add new line with trailing whitespace'
27 perl -pi -e 's,\s+$,,' a
28 hg commit -A -m 'trimmed trailing whitespace'