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