Mercurial > hg
comparison hgext/bugzilla.py @ 33393:01a90fed5840
configitems: register the 'bugzilla.apikey' config
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 07 Jul 2017 10:03:22 +0200 |
parents | b425ec7fb7f6 |
children | a752d2e7ec9c |
comparison
equal
deleted
inserted
replaced
33392:ac6446611ad2 | 33393:01a90fed5840 |
---|---|
301 from mercurial.node import short | 301 from mercurial.node import short |
302 from mercurial import ( | 302 from mercurial import ( |
303 cmdutil, | 303 cmdutil, |
304 error, | 304 error, |
305 mail, | 305 mail, |
306 registrar, | |
306 url, | 307 url, |
307 util, | 308 util, |
308 ) | 309 ) |
309 | 310 |
310 xmlrpclib = util.xmlrpclib | 311 xmlrpclib = util.xmlrpclib |
312 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | 313 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
313 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | 314 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
314 # be specifying the version(s) of Mercurial they are tested with, or | 315 # be specifying the version(s) of Mercurial they are tested with, or |
315 # leave the attribute unspecified. | 316 # leave the attribute unspecified. |
316 testedwith = 'ships-with-hg-core' | 317 testedwith = 'ships-with-hg-core' |
318 | |
319 configtable = {} | |
320 configitem = registrar.configitem(configtable) | |
321 | |
322 configitem('bugzilla', 'apikey', | |
323 default='', | |
324 ) | |
317 | 325 |
318 class bzaccess(object): | 326 class bzaccess(object): |
319 '''Base class for access to Bugzilla.''' | 327 '''Base class for access to Bugzilla.''' |
320 | 328 |
321 def __init__(self, ui): | 329 def __init__(self, ui): |
798 def __init__(self, ui): | 806 def __init__(self, ui): |
799 bzaccess.__init__(self, ui) | 807 bzaccess.__init__(self, ui) |
800 bz = self.ui.config('bugzilla', 'bzurl', | 808 bz = self.ui.config('bugzilla', 'bzurl', |
801 'http://localhost/bugzilla/') | 809 'http://localhost/bugzilla/') |
802 self.bzroot = '/'.join([bz, 'rest']) | 810 self.bzroot = '/'.join([bz, 'rest']) |
803 self.apikey = self.ui.config('bugzilla', 'apikey', '') | 811 self.apikey = self.ui.config('bugzilla', 'apikey') |
804 self.user = self.ui.config('bugzilla', 'user', 'bugs') | 812 self.user = self.ui.config('bugzilla', 'user', 'bugs') |
805 self.passwd = self.ui.config('bugzilla', 'password') | 813 self.passwd = self.ui.config('bugzilla', 'password') |
806 self.fixstatus = self.ui.config('bugzilla', 'fixstatus', 'RESOLVED') | 814 self.fixstatus = self.ui.config('bugzilla', 'fixstatus', 'RESOLVED') |
807 self.fixresolution = self.ui.config('bugzilla', 'fixresolution', | 815 self.fixresolution = self.ui.config('bugzilla', 'fixresolution', |
808 'FIXED') | 816 'FIXED') |