diff mercurial/util.py @ 26392:127b59787fd5

changegroup: use a different compression key for BZ in HG10 For "space saving", bundle1 "strip" the first two bytes of the BZ stream since they always are 'BZ'. So the current code boostrap the uncompressor with 'BZ'. This hack is impractical in more generic case so we move it in a dedicated "decompression".
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 23 Sep 2015 11:33:30 -0700
parents 60dd8e3977f0
children 1138e1d05207
line wrap: on
line diff
--- a/mercurial/util.py	Sat Sep 26 17:24:12 2015 +0800
+++ b/mercurial/util.py	Wed Sep 23 11:33:30 2015 -0700
@@ -2378,7 +2378,8 @@
     return d
 
 decompressors = {None: lambda fh: fh,
-                 'BZ': _makedecompressor(_bz2),
+                 '_truncatedBZ': _makedecompressor(_bz2),
+                 'BZ': _makedecompressor(lambda: bz2.BZ2Decompressor()),
                  'GZ': _makedecompressor(lambda: zlib.decompressobj()),
                  }
 # also support the old form by courtesies