hgbook

annotate es/examples/hook.ws @ 679:06458701453c

Fix up some links to example URLs that aren't actually real.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Apr 21 21:07:20 2009 -0700 (2009-04-21)
parents
children
rev   line source
igor@333 1 #!/bin/bash
igor@333 2
igor@333 3 hg init a
igor@333 4 cd a
igor@333 5 echo '[hooks]' > .hg/hgrc
igor@333 6 echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc
igor@333 7
igor@333 8 #$ name: simple
igor@333 9
igor@333 10 cat .hg/hgrc
igor@333 11 echo 'a ' > a
igor@333 12 hg commit -A -m 'test with trailing whitespace'
igor@333 13 echo 'a' > a
igor@333 14 hg commit -A -m 'drop trailing whitespace and try again'
igor@333 15
igor@333 16 #$ name:
igor@333 17
igor@333 18 echo '[hooks]' > .hg/hgrc
igor@333 19 echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc
igor@333 20 cp $EXAMPLE_DIR/data/check_whitespace.py .hg
igor@333 21
igor@333 22 #$ name: better
igor@333 23
igor@333 24 cat .hg/hgrc
igor@333 25 echo 'a ' >> a
igor@333 26 hg commit -A -m 'add new line with trailing whitespace'
igor@333 27 sed -i 's, *$,,' a
igor@333 28 hg commit -A -m 'trimmed trailing whitespace'
igor@333 29
igor@333 30 #$ name:
igor@333 31 exit 0