##// END OF EJS Templates
hgweb: move archivelist to standalone function...
Gregory Szorc -
r36907:04af43e0 default
parent child Browse files
Show More
@@ -132,6 +132,22 b' def readallowed(ui, req):'
132
132
133 return False
133 return False
134
134
135 def archivelist(ui, nodeid, url):
136 allowed = ui.configlist('web', 'allow_archive', untrusted=True)
137 archives = []
138
139 for typ, spec in hgweb_mod.archivespecs.iteritems():
140 if typ in allowed or ui.configbool('web', 'allow' + typ,
141 untrusted=True):
142 archives.append({
143 'type': typ,
144 'extension': spec[2],
145 'node': nodeid,
146 'url': url,
147 })
148
149 return archives
150
135 class hgwebdir(object):
151 class hgwebdir(object):
136 """HTTP server for multiple repositories.
152 """HTTP server for multiple repositories.
137
153
@@ -331,16 +347,6 b' class hgwebdir(object):'
331 def makeindex(self, wsgireq, tmpl, subdir=""):
347 def makeindex(self, wsgireq, tmpl, subdir=""):
332 req = wsgireq.req
348 req = wsgireq.req
333
349
334 def archivelist(ui, nodeid, url):
335 allowed = ui.configlist("web", "allow_archive", untrusted=True)
336 archives = []
337 for typ, spec in hgweb_mod.archivespecs.iteritems():
338 if typ in allowed or ui.configbool("web", "allow" + typ,
339 untrusted=True):
340 archives.append({"type": typ, "extension": spec[2],
341 "node": nodeid, "url": url})
342 return archives
343
344 def rawentries(subdir="", **map):
350 def rawentries(subdir="", **map):
345
351
346 descend = self.ui.configbool('web', 'descend')
352 descend = self.ui.configbool('web', 'descend')
General Comments 0
You need to be logged in to leave comments. Login now