comparison mercurial/hgweb/webcommands.py @ 26136:6defc74f3066

hgweb: move archive related attributes to requestcontext As part of this, "archive_specs" was renamed to "archivespecs" to align with naming conventions. "archive_specs" didn't technically need to be moved from hgweb. But it seemed to make sense to have all the archive code in the same class. As part of this, hgweb.configlist is no longer used, so it was deleted.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 22 Aug 2015 15:12:52 -0700
parents 0a9009d56fea
children 1aee2ab0f902
comparison
equal deleted inserted replaced
26135:edfb4d3b9672 26136:6defc74f3066
1076 files = [f for f in ctx.manifest().keys() if matchfn(f)] 1076 files = [f for f in ctx.manifest().keys() if matchfn(f)]
1077 if not files: 1077 if not files:
1078 raise ErrorResponse(HTTP_NOT_FOUND, 1078 raise ErrorResponse(HTTP_NOT_FOUND,
1079 'file(s) not found: %s' % file[0]) 1079 'file(s) not found: %s' % file[0])
1080 1080
1081 mimetype, artype, extension, encoding = web.archive_specs[type_] 1081 mimetype, artype, extension, encoding = web.archivespecs[type_]
1082 headers = [ 1082 headers = [
1083 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension)) 1083 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension))
1084 ] 1084 ]
1085 if encoding: 1085 if encoding:
1086 headers.append(('Content-Encoding', encoding)) 1086 headers.append(('Content-Encoding', encoding))