src/mercurialserver/access.py
changeset 372 80f78674c56e
parent 311 3cbde66305e4
equal deleted inserted replaced
371:e9ce904b62a9 372:80f78674c56e
    23                            'incoming changesets') % hooktype)
    23                            'incoming changesets') % hooktype)
    24     for ctx in changes.changes(repo, node):
    24     for ctx in changes.changes(repo, node):
    25         if not allow(ctx):
    25         if not allow(ctx):
    26             raise mercurial.util.Abort(_('%s: access denied for changeset %s') %
    26             raise mercurial.util.Abort(_('%s: access denied for changeset %s') %
    27                 (__name__, mercurial.node.short(ctx.node())))
    27                 (__name__, mercurial.node.short(ctx.node())))
       
    28 
       
    29 def phasehook(ui, repo, hooktype, **kwargs):
       
    30     if hooktype != 'prepushkey':
       
    31         raise mercurial.util.Abort(_('config error - hook type "%s" cannot stop '
       
    32                                      'incoming phase changes') % hooktype)
       
    33     if kwargs.get('namespace') == 'phases':
       
    34         if not ruleset.rules.allow("publish"):
       
    35             raise mercurial.util.Abort(_('%s: access denied for making %s public') %
       
    36                                        (__name__, kwargs['key'][:12]))