bos@47: #!/bin/bash bos@47: bos@44: hg init a bos@44: cd a bos@44: echo '[hooks]' > .hg/hgrc bos@167: echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc bos@44: bos@44: #$ name: simple bos@44: bos@44: cat .hg/hgrc bos@44: echo 'a ' > a bos@44: hg commit -A -m 'test with trailing whitespace' bos@49: echo 'a' > a bos@49: hg commit -A -m 'drop trailing whitespace and try again' bos@49: bos@49: #$ name: bos@49: bos@49: echo '[hooks]' > .hg/hgrc bos@150: echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc bos@150: cp $EXAMPLE_DIR/data/check_whitespace.py .hg bos@49: bos@49: #$ name: better bos@49: bos@49: cat .hg/hgrc bos@49: echo 'a ' >> a bos@49: hg commit -A -m 'add new line with trailing whitespace' bos@165: sed -i 's, *$,,' a bos@49: hg commit -A -m 'trimmed trailing whitespace' bos@74: bos@74: #$ name: bos@74: exit 0