# HG changeset patch # User Boris Feld # Date 2017-09-04 22:34:13 # Node ID 4c5730c2152313af92c0d8c9c1d764bfab433fb2 # Parent f7c9c5d8c7f4db7b844d440d7d6b8f04f22cdcdc extensions: register config item early Config items are likely to be used in during extensions setup. So we much register them before that. For example this apply to the 'win32text.warn' options. diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -232,6 +232,18 @@ def loadall(ui, whitelist=None): if isinstance(inst, error.Hint) and inst.hint: ui.warn(_("*** (%s)\n") % inst.hint) ui.traceback() + # list of (objname, loadermod, loadername) tuple: + # - objname is the name of an object in extension module, + # from which extra information is loaded + # - loadermod is the module where loader is placed + # - loadername is the name of the function, + # which takes (ui, extensionname, extraobj) arguments + # + # This one is for the list of item that must be run before running any setup + earlyextraloaders = [ + ('configtable', configitems, 'loadconfigtable'), + ] + _loadextra(ui, newindex, earlyextraloaders) broken = set() for name in _order[newindex:]: @@ -280,7 +292,6 @@ def loadall(ui, whitelist=None): extraloaders = [ ('cmdtable', commands, 'loadcmdtable'), ('colortable', color, 'loadcolortable'), - ('configtable', configitems, 'loadconfigtable'), ('filesetpredicate', fileset, 'loadpredicate'), ('internalmerge', filemerge, 'loadinternalmerge'), ('revsetpredicate', revset, 'loadpredicate'),