Fix raw files in the web UI.
--- a/mercurial/hgweb/hgweb_mod.py Thu Jun 29 18:31:17 2006 -0700
+++ b/mercurial/hgweb/hgweb_mod.py Thu Jun 29 18:34:26 2006 -0700
@@ -657,6 +657,12 @@
req.header(msg.items())
yield header_file.read()
+ def rawfileheader(**map):
+ req.header([('Content-type', map['mimetype']),
+ ('Content-disposition', 'filename=%s' % map['file']),
+ ('Content-length', str(len(map['raw'])))])
+ yield ''
+
def footer(**map):
yield self.t("footer",
motd=self.repo.ui.config("web", "motd", ""),
@@ -714,6 +720,7 @@
"repo": self.reponame,
"header": header,
"footer": footer,
+ "rawfileheader": rawfileheader,
})
if not req.form.has_key('cmd'):
--- a/templates/map-raw Thu Jun 29 18:31:17 2006 -0700
+++ b/templates/map-raw Thu Jun 29 18:34:26 2006 -0700
@@ -8,7 +8,7 @@
changesetparent = '# parent: #node#'
changesetchild = '# child: #node#'
filenodelink = ''
-filerevision = 'Content-Type: #mimetype#\nContent-Disposition: filename=#file#\n\n#raw#'
+filerevision = '#rawfileheader##raw#'
fileline = '#line#'
diffblock = '#lines#'
filediff = filediff-raw.tmpl