How to have tar.gz tarballs with hgwebdir?

Thomas Arendsen Hein thomas at intevation.de
Thu Jun 1 16:49:04 UTC 2006


* Markus F.X.J. Oberhumer <markus at oberhumer.com> [20060520 22:06]:
> I also had to apply the attached patch or else Firefox would get confused with .tar vs .tar.gz when 
> downloading.
> 
> Maybe someone with a better understanding of the RFCs involved should double check.

>      archive_specs = {
> -        'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', 'x-bzip2'),
> -        'gz': ('application/x-tar', 'tgz', '.tar.gz', 'x-gzip'),
> +        'bz2': ('application/x-bzip2', 'tbz2', '.tar.bz2', None),
> +        'gz': ('application/x-gzip', 'tgz', '.tar.gz', 'x-gzip'),
>          'zip': ('application/zip', 'zip', '.zip', None),
>          }

I pushed a similar patch to crew:

# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Date 1149179792 -7200
# Node ID d3adb454c5a9655e147fa1853fd77184ffcb42c6
# Parent  25ec4981883e5ec16e42cec535447ade8a431480
Fix automatic decompression of tarballs with Firefox.
The encoding was set to gzip/bzip2, so Firefox (correctly) assumed, that this
has to be "decoded" (i.e. decompressed).

diff -r 25ec4981883e -r d3adb454c5a9 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Thu Jun 01 09:14:27 2006 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Jun 01 18:36:32 2006 +0200
@@ -624,8 +624,8 @@ class hgweb(object):
                      diff=diff)
 
     archive_specs = {
-        'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', 'x-bzip2'),
-        'gz': ('application/x-tar', 'tgz', '.tar.gz', 'x-gzip'),
+        'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
+        'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
         'zip': ('application/zip', 'zip', '.zip', None),
         }
 

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/



More information about the Mercurial mailing list