# HG changeset patch # User Boris Feld # Date 2017-07-07 08:03:22 # Node ID 01a90fed58406bc064dca2737f326e094c2f37ec # Parent ac6446611ad27906cfe6221696fdc99b4b40644e configitems: register the 'bugzilla.apikey' config diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py --- a/hgext/bugzilla.py +++ b/hgext/bugzilla.py @@ -303,6 +303,7 @@ from mercurial import ( cmdutil, error, mail, + registrar, url, util, ) @@ -315,6 +316,13 @@ xmlrpclib = util.xmlrpclib # 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 @@ class bzrestapi(bzaccess): 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')