diff mercurial/changegroup.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 59c410db8c68
children 60825fbe2be1
line wrap: on
line diff
--- a/mercurial/changegroup.py	Sat Sep 26 17:24:12 2015 +0800
+++ b/mercurial/changegroup.py	Wed Sep 23 11:33:30 2015 -0700
@@ -163,6 +163,8 @@
         if not alg in util.decompressors:
             raise util.Abort(_('unknown stream compression type: %s')
                              % alg)
+        if alg == 'BZ':
+            alg = '_truncatedBZ'
         self._stream = util.decompressors[alg](fh)
         self._type = alg
         self.callback = None