Patchwork [6,of,9,V2] configitems: register the 'bugzilla.user' config

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 3:26 p.m.
Message ID <5e7b59b762cc7f2e3006.1500045983@FB>
Download mbox | patch
Permalink /patch/22339/
State Accepted
Headers show

Comments

Boris Feld - July 14, 2017, 3:26 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499414657 -7200
#      Fri Jul 07 10:04:17 2017 +0200
# Node ID 5e7b59b762cc7f2e3006abda288be95abf747967
# Parent  65e197186ba97e77bb9db6f28cd8a967ff46b98d
# EXP-Topic config.register.bugzilla
configitems: register the 'bugzilla.user' config

Patch

diff -r 65e197186ba9 -r 5e7b59b762cc hgext/bugzilla.py
--- a/hgext/bugzilla.py	Fri Jul 07 10:04:15 2017 +0200
+++ b/hgext/bugzilla.py	Fri Jul 07 10:04:17 2017 +0200
@@ -369,6 +369,9 @@ 
 configitem('bugzilla', 'timeout',
     default=5,
 )
+configitem('bugzilla', 'user',
+    default='bugs',
+)
 
 class bzaccess(object):
     '''Base class for access to Bugzilla.'''
@@ -445,7 +448,7 @@ 
         bzaccess.__init__(self, ui)
 
         host = self.ui.config('bugzilla', 'host')
-        user = self.ui.config('bugzilla', 'user', 'bugs')
+        user = self.ui.config('bugzilla', 'user')
         passwd = self.ui.config('bugzilla', 'password')
         db = self.ui.config('bugzilla', 'db')
         timeout = int(self.ui.config('bugzilla', 'timeout'))
@@ -693,7 +696,7 @@ 
         bzweb = self.ui.config('bugzilla', 'bzurl')
         bzweb = bzweb.rstrip("/") + "/xmlrpc.cgi"
 
-        user = self.ui.config('bugzilla', 'user', 'bugs')
+        user = self.ui.config('bugzilla', 'user')
         passwd = self.ui.config('bugzilla', 'password')
 
         self.fixstatus = self.ui.config('bugzilla', 'fixstatus')
@@ -810,7 +813,7 @@ 
         matches = self.bzproxy.User.get({'match': [user],
                                          'token': self.bztoken})
         if not matches['users']:
-            user = self.ui.config('bugzilla', 'user', 'bugs')
+            user = self.ui.config('bugzilla', 'user')
             matches = self.bzproxy.User.get({'match': [user],
                                              'token': self.bztoken})
             if not matches['users']:
@@ -852,7 +855,7 @@ 
         bz = self.ui.config('bugzilla', 'bzurl')
         self.bzroot = '/'.join([bz, 'rest'])
         self.apikey = self.ui.config('bugzilla', 'apikey')
-        self.user = self.ui.config('bugzilla', 'user', 'bugs')
+        self.user = self.ui.config('bugzilla', 'user')
         self.passwd = self.ui.config('bugzilla', 'password')
         self.fixstatus = self.ui.config('bugzilla', 'fixstatus')
         self.fixresolution = self.ui.config('bugzilla', 'fixresolution')