Beginner, very simple hook question

doahh gavin at prodia.co.uk
Sat Jan 31 03:57:01 CST 2009


Hello,

When I do a commit I would like to check that the file being committed
contains a particular piece of text if it is in a particular directory (such
as web or src). I have been reading:

http://hgbook.red-bean.com/hgbookch10.html
http://www.selenic.com/mercurial/wiki/index.cgi/Hook?highlight=(hook)

and the best I have come up with is:

pretxncommit.file.changed.notice = hg export tip | grep "This file has been
modified"

However this doesn't work reliably, I think because I am looking at the tip
and not the currently being committed file. Every now and again it will let
the file through without the text. In SVN I was using svn look to get the
information about the file being committed (both it's path so I can check
the directory and its contents so I can check for the text), is their an
equivalent in mercurial? 
-- 
View this message in context: http://www.nabble.com/Beginner%2C-very-simple-hook-question-tp21761643p21761643.html
Sent from the Mercurial mailing list archive at Nabble.com.



More information about the Mercurial mailing list