Patchwork [01,of,10,V2] configitems: register the 'bugzilla.apikey' config

login
register
mail settings
Submitter Boris Feld
Date July 11, 2017, 3:59 p.m.
Message ID <63cf0aae1472ea685e15.1499788775@FB>
Download mbox | patch
Permalink /patch/22228/
State Accepted
Headers show

Comments

Boris Feld - July 11, 2017, 3:59 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499414602 -7200
#      Fri Jul 07 10:03:22 2017 +0200
# Node ID 63cf0aae1472ea685e1543472ea722b0ea89784e
# Parent  89796a25d4bb91fb418ad3e70faad2c586902ffb
# EXP-Topic config.register.bugzilla
configitems: register the 'bugzilla.apikey' config

Patch

diff -r 89796a25d4bb -r 63cf0aae1472 hgext/bugzilla.py
--- a/hgext/bugzilla.py	Mon Jul 03 11:22:00 2017 +0200
+++ b/hgext/bugzilla.py	Fri Jul 07 10:03:22 2017 +0200
@@ -303,6 +303,7 @@ 
     cmdutil,
     error,
     mail,
+    registrar,
     url,
     util,
 )
@@ -315,6 +316,13 @@ 
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('bugzilla', 'apikey',
+    default='',
+)
+
 class bzaccess(object):
     '''Base class for access to Bugzilla.'''
 
@@ -800,7 +808,7 @@ 
         bz = self.ui.config('bugzilla', 'bzurl',
                             'http://localhost/bugzilla/')
         self.bzroot = '/'.join([bz, 'rest'])
-        self.apikey = self.ui.config('bugzilla', 'apikey', '')
+        self.apikey = self.ui.config('bugzilla', 'apikey')
         self.user = self.ui.config('bugzilla', 'user', 'bugs')
         self.passwd = self.ui.config('bugzilla', 'password')
         self.fixstatus = self.ui.config('bugzilla', 'fixstatus', 'RESOLVED')