configitems: register the 'exdiff.opts.*' config
authorBoris Feld <boris.feld@octobus.net>
Sat, 14 Oct 2017 00:33:57 +0200
changeset 34777 bb2525871d95
parent 34776 48d2b396cf6c
child 34778 bf138446ac2f
configitems: register the 'exdiff.opts.*' config
hgext/extdiff.py
--- a/hgext/extdiff.py	Sat Oct 14 00:30:14 2017 +0200
+++ b/hgext/extdiff.py	Sat Oct 14 00:33:57 2017 +0200
@@ -84,6 +84,15 @@
 
 cmdtable = {}
 command = registrar.command(cmdtable)
+
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('extdiff', r'opts\..*',
+    default='',
+    generic=True,
+)
+
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
@@ -369,7 +378,7 @@
                 path = util.findexe(cmd)
                 if path is None:
                     path = filemerge.findexternaltool(ui, cmd) or cmd
-            diffopts = ui.config('extdiff', 'opts.' + cmd, '')
+            diffopts = ui.config('extdiff', 'opts.' + cmd)
             cmdline = util.shellquote(path)
             if diffopts:
                 cmdline += ' ' + diffopts