Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 7311:de9c87fe1620
hgweb: move another utility function into the webutil module
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 03 Nov 2008 20:31:53 +0100 |
parents | bd522d09d5e3 |
children | 2dc868712dcc |
comparison
equal
deleted
inserted
replaced
7310:bd522d09d5e3 | 7311:de9c87fe1620 |
---|---|
268 allowed = self.configlist("web", "allow_archive") | 268 allowed = self.configlist("web", "allow_archive") |
269 for i, spec in self.archive_specs.iteritems(): | 269 for i, spec in self.archive_specs.iteritems(): |
270 if i in allowed or self.configbool("web", "allow" + i): | 270 if i in allowed or self.configbool("web", "allow" + i): |
271 yield {"type" : i, "extension" : spec[2], "node" : nodeid} | 271 yield {"type" : i, "extension" : spec[2], "node" : nodeid} |
272 | 272 |
273 def listfilediffs(self, tmpl, files, changeset): | |
274 for f in files[:self.maxfiles]: | |
275 yield tmpl("filedifflink", node=hex(changeset), file=f) | |
276 if len(files) > self.maxfiles: | |
277 yield tmpl("fileellipses") | |
278 | |
279 archive_specs = { | 273 archive_specs = { |
280 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None), | 274 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None), |
281 'gz': ('application/x-tar', 'tgz', '.tar.gz', None), | 275 'gz': ('application/x-tar', 'tgz', '.tar.gz', None), |
282 'zip': ('application/zip', 'zip', '.zip', None), | 276 'zip': ('application/zip', 'zip', '.zip', None), |
283 } | 277 } |