util: remove decompressors dict (API)
All in-tree consumers are now using the compengines registrar.
Extensions should switch to it as well.
--- a/mercurial/util.py Mon Nov 07 18:38:13 2016 -0800
+++ b/mercurial/util.py Mon Nov 07 18:39:08 2016 -0800
@@ -3070,29 +3070,5 @@
compengines.register(_noopengine())
-def _makedecompressor(decompcls):
- def generator(f):
- d = decompcls()
- for chunk in filechunkiter(f):
- yield d.decompress(chunk)
- def func(fh):
- return chunkbuffer(generator(fh))
- return func
-
-def _bz2():
- d = bz2.BZ2Decompressor()
- # Bzip2 stream start with BZ, but we stripped it.
- # we put it back for good measure.
- d.decompress('BZ')
- return d
-
-decompressors = {None: lambda fh: fh,
- '_truncatedBZ': _makedecompressor(_bz2),
- 'BZ': _makedecompressor(lambda: bz2.BZ2Decompressor()),
- 'GZ': _makedecompressor(lambda: zlib.decompressobj()),
- }
-# also support the old form by courtesies
-decompressors['UN'] = decompressors[None]
-
# convenient shortcut
dst = debugstacktrace