# HG changeset patch # User Elifarley Callado Coelho Cruz # Date 1270602943 10800 # Node ID 470a6ace7574db23ff9649efe6d85d428bc6a315 # Parent 90f72f47cfc22cc5b91b46ca83a2464f8e8746fc Added support for 'pretxncommit', so that one can call the ACL hook at pre-commit time too. This is useful because now it's possible to avoid violating ACL permissions much sooner, at commit time, instead of waiting for a PUSH to check if there were any invalid commits. diff -r 90f72f47cfc2 -r 470a6ace7574 hgext/acl.py --- a/hgext/acl.py Mon Apr 19 21:47:23 2010 +0200 +++ b/hgext/acl.py Tue Apr 06 22:15:43 2010 -0300 @@ -72,10 +72,11 @@ def hook(ui, repo, hooktype, node=None, source=None, **kwargs): - if hooktype != 'pretxnchangegroup': + if hooktype not in ['pretxnchangegroup', 'pretxncommit']: raise util.Abort(_('config error - hook type "%s" cannot stop ' - 'incoming changesets') % hooktype) - if source not in ui.config('acl', 'sources', 'serve').split(): + 'incoming changesets nor commits') % hooktype) + if (hooktype == 'pretxnchangegroup' and + source not in ui.config('acl', 'sources', 'serve').split()): ui.debug('acl: changes have source "%s" - skipping\n' % source) return