directaccess: register config item if possible
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Oct 2017 18:17:47 +0200
changeset 3081 25a6a2520255
parent 3080 461c9d940519
child 3082 326e0ee1eed1
directaccess: register config item if possible Mercurial 4.4 warns about unregistered config.
hgext3rd/evolve/hack/directaccess.py
--- a/hgext3rd/evolve/hack/directaccess.py	Thu Oct 19 14:46:06 2017 +0200
+++ b/hgext3rd/evolve/hack/directaccess.py	Thu Oct 19 18:17:47 2017 +0200
@@ -24,6 +24,14 @@
     from mercurial import cmdutil
     command = cmdutil.command(cmdtable)
 
+if util.safehasattr(registrar, 'configitem'):
+    configtable = {}
+    configitem = registrar.configitem(configtable)
+
+    configitem('directaccess', 'loadsafter',
+               default=[],
+    )
+
 # By default, all the commands have directaccess with warnings
 # List of commands that have no directaccess and directaccess with no warning
 directaccesslevel = [