Thanks In this case, I will just add a new extension for registering all configs used in our in-process hooks.
On Sun, Dec 3, 2017 at 2:04 AM, Yuya Nishihara <y...@tcha.org> wrote: > On Thu, 30 Nov 2017 11:00:30 -0500, Olivier Trempe wrote: > > First, I understand that the new configitems.loadconfigtable is called > for > > each activated extension and expects to find a configtable object within > > the extension module to inject the extension's configs into the ui's > known > > configs. I had to step into the code to find out about it and it is not > > documented in https://www.mercurial-scm.org/wiki/WritingExtensions > > > > What would be the proper way to register a config used in a hook? > > > > There is no call to configitems.loadconfigtable when a hook module is > > loaded. If I manually register a config on the ui object passed to the > > hook, this config will be registered as many times as the hook is > called. I > > could check if the config has already been registered before registering > > it, but this is more a workaround than a clean solution. > > > > Is this something that is not properly handled yet? Should > > configitems.loadconfigtable be called right after obj = > __import__(modname) in > > hook.py? > > Perhaps the hook script can be loaded as an extension? I don't think we'll > extend the config registrar machinery to hooks since in-process hooks are > discouraged. >
_______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel