Comments
Patch
@@ -23,3 +23,13 @@ class configitem(object):
self.section = section
self.name = name
self.default = default
+
+coreitems = {}
+
+def coreconfigitem(*args, **kwargs):
+ item = configitem(*args, **kwargs)
+ section = coreitems.setdefault(item.section, {})
+ if item.name in section:
+ msg = "duplicated config item registration for '%s.%s'"
+ raise error.ProgrammingError(msg % (item.section, item.name))
+ section[item.name] = item
@@ -27,6 +27,7 @@ from .node import hex
from . import (
color,
config,
+ configitems,
encoding,
error,
formatter,
@@ -178,6 +179,7 @@ class ui(object):
self._bufferapplylabels = None
self.quiet = self.verbose = self.debugflag = self.tracebackflag = False
self._reportuntrusted = True
+ self._knownconfig = configitems.coreitems
self._ocfg = config.config() # overlay
self._tcfg = config.config() # trusted
self._ucfg = config.config() # untrusted