Proper way to register configs in hooks

Olivier Trempe oliviertrempe at
Thu Nov 30 11:00:30 EST 2017


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

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


Olivier Trempe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Mercurial-devel mailing list