hgweb: make sure command options are set to all ui objects
authorYuya Nishihara <yuya@tcha.org>
Sat, 21 Nov 2015 13:28:12 +0900
changeset 27182 71aa5a26162d
parent 27181 a9cecc7b68d3
child 27183 0945539a3a6b
hgweb: make sure command options are set to all ui objects Before this patch, it was unclear why the httpservice object could read the server options (e.g. --port) from 'ui'. It just worked because repo.ui is ui.
mercurial/hgweb/__init__.py
--- a/mercurial/hgweb/__init__.py	Sat Oct 31 22:26:50 2015 +0900
+++ b/mercurial/hgweb/__init__.py	Sat Nov 21 13:28:12 2015 +0900
@@ -90,8 +90,10 @@
     if opts.get('port'):
         opts['port'] = util.getport(opts.get('port'))
 
+    alluis = set([ui])
     if repo:
         baseui = repo.baseui
+        alluis.update([repo.baseui, repo.ui])
     else:
         baseui = ui
     optlist = ("name templates style address port prefix ipv6"
@@ -100,9 +102,8 @@
         val = opts.get(o, '')
         if val in (None, ''): # should check against default options instead
             continue
-        baseui.setconfig("web", o, val, 'serve')
-        if repo and repo.ui != baseui:
-            repo.ui.setconfig("web", o, val, 'serve')
+        for u in alluis:
+            u.setconfig("web", o, val, 'serve')
 
     webconf = opts.get('web_conf') or opts.get('webdir_conf')
     if webconf: