Some useful examples of Hooks. See also http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html
Don't commit code marked otherwise
Just add # NOCOMMIT in temporary sourcecode
pretxncommit.nocommit = hg export tip | (! egrep -q '^\+.*#[ \t]*NOCOMMIT.*$')
Check for whitespace
pretxncommit.whitespace = hg export tip | (! egrep -q '^\+.*[ \t]$')
Don't commit breakpoints
pretxncommit.pdb = hg export tip | (! egrep -q '^\+.*pdb\.set_trace\(\).*$')