configitems: register the 'gpg.cmd' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:42:33 +0200
changeset 34501 b0c42fec8dc2
parent 34500 6c705bf6a8ff
child 34502 d54526c257af
configitems: register the 'gpg.cmd' config
hgext/gpg.py
--- a/hgext/gpg.py	Fri Jun 30 03:42:50 2017 +0200
+++ b/hgext/gpg.py	Fri Jun 30 03:42:33 2017 +0200
@@ -30,6 +30,13 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('gpg', 'cmd',
+    default='gpg',
+)
+
 class gpg(object):
     def __init__(self, path, key=None):
         self.path = path
@@ -91,7 +98,7 @@
 
 def newgpg(ui, **opts):
     """create a new gpg instance"""
-    gpgpath = ui.config("gpg", "cmd", "gpg")
+    gpgpath = ui.config("gpg", "cmd")
     gpgkey = opts.get('key')
     if not gpgkey:
         gpgkey = ui.config("gpg", "key", None)