Patchwork [10,of,18] configitems: register the 'acl.sources' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:57 a.m.
Message ID <9092748ab0a571304ac5.1498964258@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21904/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498786027 -7200
#      Fri Jun 30 03:27:07 2017 +0200
# Node ID 9092748ab0a571304ac58163ed1e570b06e0bf9d
# Parent  c1664a0daf3c302ff04c5c8eded0b3eb0c14e3e0
# EXP-Topic config.register.acl
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 9092748ab0a5
configitems: register the 'acl.sources' config

The existing default value is now formally declared. It seems like the whole
config should be a list, but this is an adventure for the next changesets.

Patch

diff --git a/hgext/acl.py b/hgext/acl.py
--- a/hgext/acl.py
+++ b/hgext/acl.py
@@ -218,6 +218,9 @@  configitem = registrar.configitem(config
 configitem('acl', 'config',
     default=None,
 )
+configitem('acl', 'sources',
+    default='serve',
+)
 
 def _getusers(ui, group):
 
@@ -289,7 +292,7 @@  def hook(ui, repo, hooktype, node=None, 
         raise error.Abort(_('config error - hook type "%s" cannot stop '
                            'incoming changesets nor commits') % hooktype)
     if (hooktype == 'pretxnchangegroup' and
-        source not in ui.config('acl', 'sources', 'serve').split()):
+        source not in ui.config('acl', 'sources').split()):
         ui.debug('acl: changes have source "%s" - skipping\n' % source)
         return