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