hgweb: kill parentui references
authorMatt Mackall <mpm@selenic.com>
Sun, 26 Apr 2009 16:50:43 -0500
changeset 8191 35604226d712
parent 8190 9b8ac5fb7760
child 8192 5fd8e60a935d
hgweb: kill parentui references
hgext/zeroconf/__init__.py
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/hgext/zeroconf/__init__.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/hgext/zeroconf/__init__.py	Sun Apr 26 16:50:43 2009 -0500
@@ -112,7 +112,7 @@
 class hgwebdirzc(hgwebdir_mod.hgwebdir):
     def run(self):
         for r, p in self.repos:
-            u = self.parentui.copy()
+            u = self.ui.copy()
             u.readconfig(os.path.join(p, '.hg', 'hgrc'))
             n = os.path.basename(r)
             publish(n, "hgweb", p, int(u.config("web", "port", 8000)))
--- a/mercurial/hgweb/hgweb_mod.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Apr 26 16:50:43 2009 -0500
@@ -25,10 +25,10 @@
 class hgweb(object):
     def __init__(self, repo, name=None):
         if isinstance(repo, str):
-            parentui = ui.ui()
-            parentui.setconfig('ui', 'report_untrusted', 'off')
-            parentui.setconfig('ui', 'interactive', 'off')
-            self.repo = hg.repository(parentui, repo)
+            u = ui.ui()
+            u.setconfig('ui', 'report_untrusted', 'off')
+            u.setconfig('ui', 'interactive', 'off')
+            self.repo = hg.repository(u, repo)
         else:
             self.repo = repo
 
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Apr 26 16:50:43 2009 -0500
@@ -17,17 +17,17 @@
 
 # This is a stopgap
 class hgwebdir(object):
-    def __init__(self, conf, parentui=None):
+    def __init__(self, conf, baseui=None):
         def cleannames(items):
             return [(util.pconvert(name).strip('/'), path)
                     for name, path in items]
 
-        if parentui:
-           self.parentui = parentui
+        if baseui:
+           self.ui = baseui.copy()
         else:
-            self.parentui = ui.ui()
-            self.parentui.setconfig('ui', 'report_untrusted', 'off')
-            self.parentui.setconfig('ui', 'interactive', 'off')
+            self.ui = ui.ui()
+            self.ui.setconfig('ui', 'report_untrusted', 'off')
+            self.ui.setconfig('ui', 'interactive', 'off')
 
         self.motd = None
         self.style = 'paper'
@@ -144,7 +144,7 @@
                     if real:
                         req.env['REPO_NAME'] = virtual
                         try:
-                            repo = hg.repository(self.parentui, real)
+                            repo = hg.repository(self.ui, real)
                             return hgweb(repo).run_wsgi(req)
                         except IOError, inst:
                             msg = inst.strerror
@@ -203,7 +203,7 @@
                     continue
                 name = name[len(subdir):]
 
-                u = self.parentui.copy()
+                u = self.ui.copy()
                 try:
                     u.readconfig(os.path.join(path, '.hg', 'hgrc'))
                 except Exception, e:
@@ -297,7 +297,7 @@
                 yield config('web', 'motd', '')
 
         def config(section, name, default=None, untrusted=True):
-            return self.parentui.config(section, name, default, untrusted)
+            return self.ui.config(section, name, default, untrusted)
 
         if self._baseurl is not None:
             req.env['SCRIPT_NAME'] = self._baseurl