Merge with myself.
authorbos@serpentine.internal.keyresearch.com
Thu, 01 Sep 2005 07:43:53 -0700
changeset 1186 508c7d1b3e1c
parent 1185 2ae9c319e6fe (diff)
parent 1184 9462df772bc8 (current diff)
child 1187 120aa5fc7ced
Merge with myself.
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -689,7 +689,14 @@ class hgweb:
             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)