Patchwork [12,of,14] configitems: register the 'gpg.cmd' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 6, 2017, 9:22 a.m.
Message ID <b0c42fec8dc28dec5408.1507281748@FB>
Download mbox | patch
Permalink /patch/24593/
State Accepted
Headers show

Comments

Boris Feld - Oct. 6, 2017, 9:22 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498786953 -7200
#      Fri Jun 30 03:42:33 2017 +0200
# Node ID b0c42fec8dc28dec5408c0ec506359afc64e4915
# Parent  6c705bf6a8ff9cd91769e547b3d8c2dae5c5c9c5
# EXP-Topic config.register.gpg
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r b0c42fec8dc2
configitems: register the 'gpg.cmd' config

Patch

diff -r 6c705bf6a8ff -r b0c42fec8dc2 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)