Mercurial > hgbook
comparison ja/examples/hook.ws @ 290:b0db5adf11c1 ja_root
fork Japanese translation.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Wed, 06 Feb 2008 17:43:11 +0900 |
parents | en/examples/hook.ws@e67251ac336f |
children |
comparison
equal
deleted
inserted
replaced
289:7be02466421b | 290:b0db5adf11c1 |
---|---|
1 #!/bin/bash | |
2 | |
3 hg init a | |
4 cd a | |
5 echo '[hooks]' > .hg/hgrc | |
6 echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc | |
7 | |
8 #$ name: simple | |
9 | |
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' | |
15 | |
16 #$ name: | |
17 | |
18 echo '[hooks]' > .hg/hgrc | |
19 echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc | |
20 cp $EXAMPLE_DIR/data/check_whitespace.py .hg | |
21 | |
22 #$ name: better | |
23 | |
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' | |
29 | |
30 #$ name: | |
31 exit 0 |