798 if cnode == key or key == 'tip': |
798 if cnode == key or key == 'tip': |
799 arch_version = short(cnode) |
799 arch_version = short(cnode) |
800 name = "%s-%s" % (reponame, arch_version) |
800 name = "%s-%s" % (reponame, arch_version) |
801 mimetype, artype, extension, encoding = web.archive_specs[type_] |
801 mimetype, artype, extension, encoding = web.archive_specs[type_] |
802 headers = [ |
802 headers = [ |
803 ('Content-Type', mimetype), |
|
804 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension)) |
803 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension)) |
805 ] |
804 ] |
806 if encoding: |
805 if encoding: |
807 headers.append(('Content-Encoding', encoding)) |
806 headers.append(('Content-Encoding', encoding)) |
808 req.header(headers) |
807 req.header(headers) |
809 req.respond(HTTP_OK) |
808 req.respond(HTTP_OK, mimetype) |
810 |
809 |
811 ctx = webutil.changectx(web.repo, req) |
810 ctx = webutil.changectx(web.repo, req) |
812 archival.archive(web.repo, req, cnode, artype, prefix=name, |
811 archival.archive(web.repo, req, cnode, artype, prefix=name, |
813 matchfn=scmutil.match(ctx, []), |
812 matchfn=scmutil.match(ctx, []), |
814 subrepos=web.configbool("web", "archivesubrepos")) |
813 subrepos=web.configbool("web", "archivesubrepos")) |