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 {{{#!FORMAT python pretxncommit.nocommit = hg export tip | (! egrep -q '^\+.*#[ \t]*NOCOMMIT.*$') }}} === Check for whitespace === {{{#!FORMAT python pretxncommit.whitespace = hg export tip | (! egrep -q '^\+.*[ \t]$')}}} === Don't commit breakpoints === {{{#!FORMAT python pretxncommit.pdb = hg export tip | (! egrep -q '^\+.*pdb\.set_trace\(\).*$')}}}