Mercurial > hg-stable
changeset 2534:d5a3cc6520d5
Fix raw files in the web UI.
author | Eric Hopper <hopper@omnifarious.org> |
---|---|
date | Thu, 29 Jun 2006 18:34:26 -0700 |
parents | 589474a1dc36 |
children | b8ccf6386db7 |
files | mercurial/hgweb/hgweb_mod.py templates/map-raw |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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