comparison 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
comparison
equal deleted inserted replaced
26391:f206543d8380 26392:127b59787fd5
161 if alg == 'UN': 161 if alg == 'UN':
162 alg = None # get more modern without breaking too much 162 alg = None # get more modern without breaking too much
163 if not alg in util.decompressors: 163 if not alg in util.decompressors:
164 raise util.Abort(_('unknown stream compression type: %s') 164 raise util.Abort(_('unknown stream compression type: %s')
165 % alg) 165 % alg)
166 if alg == 'BZ':
167 alg = '_truncatedBZ'
166 self._stream = util.decompressors[alg](fh) 168 self._stream = util.decompressors[alg](fh)
167 self._type = alg 169 self._type = alg
168 self.callback = None 170 self.callback = None
169 def compressed(self): 171 def compressed(self):
170 return self._type is not None 172 return self._type is not None