Show More
@@ -606,9 +606,13 b' class hgweb(object):' | |||
|
606 | 606 | 'zip': ('application/zip', 'zip', '.zip', None), |
|
607 | 607 | } |
|
608 | 608 | |
|
609 |
def archive(self, req, |
|
|
609 | def archive(self, req, id, type_): | |
|
610 | 610 | reponame = re.sub(r"\W+", "-", os.path.basename(self.reponame)) |
|
611 | name = "%s-%s" % (reponame, short(cnode)) | |
|
611 | cnode = self.repo.lookup(id) | |
|
612 | arch_version = id | |
|
613 | if cnode == id: | |
|
614 | arch_version = short(cnode) | |
|
615 | name = "%s-%s" % (reponame, arch_version) | |
|
612 | 616 | mimetype, artype, extension, encoding = self.archive_specs[type_] |
|
613 | 617 | headers = [('Content-type', mimetype), |
|
614 | 618 | ('Content-disposition', 'attachment; filename=%s%s' % |
@@ -989,12 +993,11 b' class hgweb(object):' | |||
|
989 | 993 | req.write(z.flush()) |
|
990 | 994 | |
|
991 | 995 | def do_archive(self, req): |
|
992 | changeset = self.repo.lookup(req.form['node'][0]) | |
|
993 | 996 | type_ = req.form['type'][0] |
|
994 | 997 | allowed = self.configlist("web", "allow_archive") |
|
995 | 998 | if (type_ in self.archives and (type_ in allowed or |
|
996 | 999 | self.configbool("web", "allow" + type_, False))): |
|
997 |
self.archive(req, |
|
|
1000 | self.archive(req, req.form['node'][0], type_) | |
|
998 | 1001 | return |
|
999 | 1002 | |
|
1000 | 1003 | req.write(self.t("error")) |
General Comments 0
You need to be logged in to leave comments.
Login now