##// END OF EJS Templates
Fixed [web] allow_archive for comma separated parameters by using ui.configlist....
Thomas Arendsen Hein -
r2500:76ff5efe default
parent child Browse files
Show More
@@ -50,8 +50,7 b' class hgweb(object):'
50 50 self.allowpull = self.repo.ui.configbool("web", "allowpull", True)
51 51
52 52 def archivelist(self, nodeid):
53 allowed = (self.repo.ui.config("web", "allow_archive", "")
54 .replace(",", " ").split())
53 allowed = self.repo.ui.configlist("web", "allow_archive")
55 54 for i in self.archives:
56 55 if i in allowed or self.repo.ui.configbool("web", "allow" + i):
57 56 yield {"type" : i, "node" : nodeid, "url": ""}
@@ -818,7 +817,7 b' class hgweb(object):'
818 817 def do_archive(self, req):
819 818 changeset = self.repo.lookup(req.form['node'][0])
820 819 type_ = req.form['type'][0]
821 allowed = self.repo.ui.config("web", "allow_archive", "").split()
820 allowed = self.repo.ui.configlist("web", "allow_archive")
822 821 if (type_ in self.archives and (type_ in allowed or
823 822 self.repo.ui.configbool("web", "allow" + type_, False))):
824 823 self.archive(req, changeset, type_)
@@ -60,8 +60,7 b' class hgwebdir(object):'
60 60 "footer": footer})
61 61
62 62 def archivelist(ui, nodeid, url):
63 allowed = (ui.config("web", "allow_archive", "")
64 .replace(",", " ").split())
63 allowed = ui.configlist("web", "allow_archive")
65 64 for i in ['zip', 'gz', 'bz2']:
66 65 if i in allowed or ui.configbool("web", "allow" + i):
67 66 yield {"type" : i, "node": nodeid, "url": url}
@@ -15,9 +15,7 b' hg addremove'
15 15 hg commit -m 3
16 16 echo "[web]" >> .hg/hgrc
17 17 echo "name = test-archive" >> .hg/hgrc
18 echo "allowzip = true" >> .hg/hgrc
19 echo "allowgz = true" >> .hg/hgrc
20 echo "allowbz2 = true" >> .hg/hgrc
18 echo "allow_archive = gz bz2, zip" >> .hg/hgrc
21 19 hg serve -p 20059 -d --pid-file=hg.pid
22 20
23 21 TIP=`hg id -v | cut -f1 -d' '`
General Comments 0
You need to be logged in to leave comments. Login now