changeset 1186:508c7d1b3e1c

Merge with myself.
author bos@serpentine.internal.keyresearch.com
date Thu, 01 Sep 2005 07:43:53 -0700
parents 2ae9c319e6fe (diff) 9462df772bc8 (current diff)
children 120aa5fc7ced
files
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Thu Sep 01 07:37:49 2005 -0700
+++ b/mercurial/hgweb.py	Thu Sep 01 07:43:53 2005 -0700
@@ -689,7 +689,14 @@
             mff = self.repo.manifest.readflags(mnode)
             mtime = int(time.time())
 
-            req.httphdr('application/octet-stream', name[:-1] + '.tar.' + type)
+            if type == "gz":
+                encoding = "gzip"
+            else:
+                encoding = "x-bzip2"
+            req.header([('Content-type', 'application/x-tar'), 
+                    ('Content-disposition', 'attachment; filename=%s%s%s' %
+                        (name[:-1], '.tar.', type)),
+                    ('Content-encoding', encoding)])
             for fname in files:
                 rcont = self.repo.file(fname).read(mf[fname])
                 finfo = tarfile.TarInfo(name + fname)