hgbook

view ja/examples/hook.msglen @ 1074:00b10e26e3e6

refined
author Zhaoping Sun <zhaopingsun@gmail.com>
date Mon Nov 16 21:04:22 2009 -0500 (2009-11-16)
parents
children
line source
1 #!/bin/sh
3 hg init a
4 cd a
5 echo '[hooks]' > .hg/hgrc
6 echo 'pretxncommit.msglen = test `hg tip --template {desc} | wc -c` -ge 10' >> .hg/hgrc
8 #$ name: go
10 cat .hg/hgrc
11 echo a > a
12 hg add a
13 hg commit -A -m 'too short'
14 hg commit -A -m 'long enough'