diff mercurial/hgweb/hgweb_mod.py @ 2358:8819fc1dcf4b

hgweb: add allow_archive support to [web] section of hgrc
author TK Soh <teekaysoh@yahoo.com>
date Thu, 01 Jun 2006 10:02:24 -0500
parents 2db831b33e8f
children a392eaa81f29
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -48,8 +48,9 @@ class hgweb(object):
             self.allowpull = self.repo.ui.configbool("web", "allowpull", True)
 
     def archivelist(self, nodeid):
+        al = self.repo.ui.config("web", "allow_archive", "").split()
         for i in self.archives:
-            if self.repo.ui.configbool("web", "allow" + i, False):
+            if i in al or self.repo.ui.configbool("web", "allow" + i, False):
                 yield {"type" : i, "node" : nodeid, "url": ""}
 
     def listfiles(self, files, mf):
@@ -803,8 +804,9 @@ class hgweb(object):
         elif cmd == 'archive':
             changeset = self.repo.lookup(req.form['node'][0])
             type = req.form['type'][0]
-            if (type in self.archives and
-                self.repo.ui.configbool("web", "allow" + type, False)):
+            allowed = self.repo.ui.config("web", "allow_archive", "").split()
+            if (type in self.archives and (type in allowed or
+                self.repo.ui.configbool("web", "allow" + type, False))):
                 self.archive(req, changeset, type)
                 return