comparison mercurial/hgweb/hgwebdir_mod.py @ 12691:1b1a9038a71a

hgweb: fix hgweb_mod as well as hgwebdir_mod
author Augie Fackler <durin42@gmail.com>
date Sun, 10 Oct 2010 10:42:44 -0500
parents 94e7bd38d9a3
children ef969e58a394
comparison
equal deleted inserted replaced
12690:94e7bd38d9a3 12691:1b1a9038a71a
39 if prefix: 39 if prefix:
40 name = prefix + '/' + name 40 name = prefix + '/' + name
41 repos.append((name, path)) 41 repos.append((name, path))
42 return repos 42 return repos
43 43
44 class wsgiui(ui.ui):
45 # default termwidth breaks under mod_wsgi
46 def termwidth(self):
47 return 80
48
49 class hgwebdir(object): 44 class hgwebdir(object):
50 refreshinterval = 20 45 refreshinterval = 20
51 46
52 def __init__(self, conf, baseui=None): 47 def __init__(self, conf, baseui=None):
53 self.conf = conf 48 self.conf = conf
61 return 56 return
62 57
63 if self.baseui: 58 if self.baseui:
64 u = self.baseui.copy() 59 u = self.baseui.copy()
65 else: 60 else:
66 u = wsgiui() 61 u = webutil.wsgiui()
67 u.setconfig('ui', 'report_untrusted', 'off') 62 u.setconfig('ui', 'report_untrusted', 'off')
68 u.setconfig('ui', 'interactive', 'off') 63 u.setconfig('ui', 'interactive', 'off')
69 64
70 if not isinstance(self.conf, (dict, list, tuple)): 65 if not isinstance(self.conf, (dict, list, tuple)):
71 map = {'paths': 'hgweb-paths'} 66 map = {'paths': 'hgweb-paths'}