70 return match.match(repo.root, '', pats) |
70 return match.match(repo.root, '', pats) |
71 return match.exact(repo.root, '', []) |
71 return match.exact(repo.root, '', []) |
72 |
72 |
73 |
73 |
74 def hook(ui, repo, hooktype, node=None, source=None, **kwargs): |
74 def hook(ui, repo, hooktype, node=None, source=None, **kwargs): |
75 if hooktype != 'pretxnchangegroup': |
75 if hooktype not in ['pretxnchangegroup', 'pretxncommit']: |
76 raise util.Abort(_('config error - hook type "%s" cannot stop ' |
76 raise util.Abort(_('config error - hook type "%s" cannot stop ' |
77 'incoming changesets') % hooktype) |
77 'incoming changesets nor commits') % hooktype) |
78 if source not in ui.config('acl', 'sources', 'serve').split(): |
78 if (hooktype == 'pretxnchangegroup' and |
|
79 source not in ui.config('acl', 'sources', 'serve').split()): |
79 ui.debug('acl: changes have source "%s" - skipping\n' % source) |
80 ui.debug('acl: changes have source "%s" - skipping\n' % source) |
80 return |
81 return |
81 |
82 |
82 user = None |
83 user = None |
83 if source == 'serve' and 'url' in kwargs: |
84 if source == 'serve' and 'url' in kwargs: |