comparison mercurial/hgweb/hgwebdir_mod.py @ 5965:abe373e16fe6

hgweb: forgot to centralize the req.write() calls in hgwebdir
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 28 Jan 2008 16:35:02 +0100
parents 3340aa5a64f7
children f25070ecf334
comparison
equal deleted inserted replaced
5964:1cd1582ef25f 5965:abe373e16fe6
88 return 88 return
89 89
90 # top-level index 90 # top-level index
91 elif not virtual: 91 elif not virtual:
92 tmpl = self.templater(req) 92 tmpl = self.templater(req)
93 self.makeindex(req, tmpl) 93 req.write(self.makeindex(req, tmpl))
94 return 94 return
95 95
96 # nested indexes and hgwebs 96 # nested indexes and hgwebs
97 repos = dict(self.repos) 97 repos = dict(self.repos)
98 while virtual: 98 while virtual:
110 110
111 # browse subdirectories 111 # browse subdirectories
112 subdir = virtual + '/' 112 subdir = virtual + '/'
113 if [r for r in repos if r.startswith(subdir)]: 113 if [r for r in repos if r.startswith(subdir)]:
114 tmpl = self.templater(req) 114 tmpl = self.templater(req)
115 self.makeindex(req, tmpl, subdir) 115 req.write(self.makeindex(req, tmpl, subdir))
116 return 116 return
117 117
118 up = virtual.rfind('/') 118 up = virtual.rfind('/')
119 if up < 0: 119 if up < 0:
120 break 120 break
225 sort = [("sort_%s" % column, 225 sort = [("sort_%s" % column,
226 "%s%s" % ((not descending and column == sortcolumn) 226 "%s%s" % ((not descending and column == sortcolumn)
227 and "-" or "", column)) 227 and "-" or "", column))
228 for column in sortable] 228 for column in sortable]
229 229
230 req.write(tmpl("index", entries=entries, subdir=subdir, 230 return tmpl("index", entries=entries, subdir=subdir,
231 sortcolumn=sortcolumn, descending=descending, 231 sortcolumn=sortcolumn, descending=descending,
232 **dict(sort))) 232 **dict(sort))
233 233
234 def templater(self, req): 234 def templater(self, req):
235 235
236 def header(**map): 236 def header(**map):
237 ctype = tmpl('mimetype', encoding=util._encoding) 237 ctype = tmpl('mimetype', encoding=util._encoding)