mercurial/hgweb/hgweb_mod.py
changeset 30749 e38e7ea21987
parent 30748 319914d57b9e
child 30766 d7bf7d2bd5ab
--- a/mercurial/hgweb/hgweb_mod.py	Tue Jan 10 23:34:39 2017 +0800
+++ b/mercurial/hgweb/hgweb_mod.py	Tue Jan 10 23:41:58 2017 +0800
@@ -53,6 +53,12 @@
     'pushkey': 'push',
 }
 
+archivespecs = util.sortdict((
+    ('zip', ('application/zip', 'zip', '.zip', None)),
+    ('gz', ('application/x-gzip', 'tgz', '.tar.gz', None)),
+    ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)),
+))
+
 def makebreadcrumb(url, prefix=''):
     '''Return a 'URL breadcrumb' list
 
@@ -89,6 +95,8 @@
         self.repo = repo
         self.reponame = app.reponame
 
+        self.archivespecs = archivespecs
+
         self.maxchanges = self.configint('web', 'maxchanges', 10)
         self.stripecount = self.configint('web', 'stripes', 1)
         self.maxshortchanges = self.configint('web', 'maxshortchanges', 60)
@@ -124,12 +132,6 @@
         return self.repo.ui.configlist(section, name, default,
                                        untrusted=untrusted)
 
-    archivespecs = util.sortdict((
-        ('zip', ('application/zip', 'zip', '.zip', None)),
-        ('gz', ('application/x-gzip', 'tgz', '.tar.gz', None)),
-        ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)),
-    ))
-
     def archivelist(self, nodeid):
         allowed = self.configlist('web', 'allow_archive')
         for typ, spec in self.archivespecs.iteritems():