view en/examples/hook.msglen @ 799:7107b79427a3

Propagate 4e23c220d1b0 Update chapter 2
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 18 Jun 2009 19:11:36 +0900
parents 914babdc99c8
children
line wrap: on
line source

#!/bin/sh

hg init a
cd a
echo '[hooks]' > .hg/hgrc
echo 'pretxncommit.msglen = test `hg tip --template {desc} | wc -c` -ge 10' >> .hg/hgrc

#$ name: go

cat .hg/hgrc
echo a > a
hg add a
hg commit -A -m 'too short'
hg commit -A -m 'long enough'