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\(\).*$')

UsefulHooks (last edited 2012-06-20 16:03:20 by 93-172-104-238)