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