Patchwork [08,of,10] configitems: register the 'bugzilla.user' config

login
register
mail settings
Submitter Boris Feld
Date July 12, 2017, 12:41 p.m.
Message ID <b3631f450acf389945b3.1499863291@FB>
Download mbox | patch
Permalink /patch/22262/
State Accepted
Headers show

Comments

Boris Feld - July 12, 2017, 12:41 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 b3631f450acf389945b3abd5c68137f7f06e783d
# Parent  5b67961350d4084c8e50c14826335f69711fa65d
# EXP-Topic config.register.bugzilla
configitems: register the 'bugzilla.user' config

Patch

diff -r 5b67961350d4 -r b3631f450acf 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
@@ -367,6 +367,9 @@ 
 configitem('bugzilla', 'timeout',
     default=5,
 )
+configitem('bugzilla', 'user',
+    default='bugs',
+)
 
 class bzaccess(object):
     '''Base class for access to Bugzilla.'''
@@ -443,7 +446,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'))
@@ -691,7 +694,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')
@@ -808,7 +811,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']:
@@ -850,7 +853,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')