diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -128,10 +128,7 @@ class requestcontext(object): untrusted=untrusted) def archivelist(self, nodeid): - allowed = self.configlist('web', 'allow_archive') - for typ, spec in webutil.archivespecs.iteritems(): - if typ in allowed or self.configbool('web', 'allow%s' % typ): - yield {'type': typ, 'extension': spec[2], 'node': nodeid} + return webutil.archivelist(self.repo.ui, nodeid) def templater(self, req): # determine scheme, port and server name diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -49,7 +49,7 @@ archivespecs = util.sortdict(( ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)), )) -def archivelist(ui, nodeid, url): +def archivelist(ui, nodeid, url=None): allowed = ui.configlist('web', 'allow_archive', untrusted=True) archives = []