##// END OF EJS Templates
hgweb: kill parentui references
Matt Mackall -
r8191:35604226 default
parent child Browse files
Show More
@@ -112,7 +112,7 class hgwebzc(hgweb_mod.hgweb):
112 112 class hgwebdirzc(hgwebdir_mod.hgwebdir):
113 113 def run(self):
114 114 for r, p in self.repos:
115 u = self.parentui.copy()
115 u = self.ui.copy()
116 116 u.readconfig(os.path.join(p, '.hg', 'hgrc'))
117 117 n = os.path.basename(r)
118 118 publish(n, "hgweb", p, int(u.config("web", "port", 8000)))
@@ -25,10 +25,10 perms = {
25 25 class hgweb(object):
26 26 def __init__(self, repo, name=None):
27 27 if isinstance(repo, str):
28 parentui = ui.ui()
29 parentui.setconfig('ui', 'report_untrusted', 'off')
30 parentui.setconfig('ui', 'interactive', 'off')
31 self.repo = hg.repository(parentui, repo)
28 u = ui.ui()
29 u.setconfig('ui', 'report_untrusted', 'off')
30 u.setconfig('ui', 'interactive', 'off')
31 self.repo = hg.repository(u, repo)
32 32 else:
33 33 self.repo = repo
34 34
@@ -17,17 +17,17 from request import wsgirequest
17 17
18 18 # This is a stopgap
19 19 class hgwebdir(object):
20 def __init__(self, conf, parentui=None):
20 def __init__(self, conf, baseui=None):
21 21 def cleannames(items):
22 22 return [(util.pconvert(name).strip('/'), path)
23 23 for name, path in items]
24 24
25 if parentui:
26 self.parentui = parentui
25 if baseui:
26 self.ui = baseui.copy()
27 27 else:
28 self.parentui = ui.ui()
29 self.parentui.setconfig('ui', 'report_untrusted', 'off')
30 self.parentui.setconfig('ui', 'interactive', 'off')
28 self.ui = ui.ui()
29 self.ui.setconfig('ui', 'report_untrusted', 'off')
30 self.ui.setconfig('ui', 'interactive', 'off')
31 31
32 32 self.motd = None
33 33 self.style = 'paper'
@@ -144,7 +144,7 class hgwebdir(object):
144 144 if real:
145 145 req.env['REPO_NAME'] = virtual
146 146 try:
147 repo = hg.repository(self.parentui, real)
147 repo = hg.repository(self.ui, real)
148 148 return hgweb(repo).run_wsgi(req)
149 149 except IOError, inst:
150 150 msg = inst.strerror
@@ -203,7 +203,7 class hgwebdir(object):
203 203 continue
204 204 name = name[len(subdir):]
205 205
206 u = self.parentui.copy()
206 u = self.ui.copy()
207 207 try:
208 208 u.readconfig(os.path.join(path, '.hg', 'hgrc'))
209 209 except Exception, e:
@@ -297,7 +297,7 class hgwebdir(object):
297 297 yield config('web', 'motd', '')
298 298
299 299 def config(section, name, default=None, untrusted=True):
300 return self.parentui.config(section, name, default, untrusted)
300 return self.ui.config(section, name, default, untrusted)
301 301
302 302 if self._baseurl is not None:
303 303 req.env['SCRIPT_NAME'] = self._baseurl
General Comments 0
You need to be logged in to leave comments. Login now