util: remove decompressors dict (API)
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 07 Nov 2016 18:39:08 -0800
changeset 30355 c52faa621d9f
parent 30354 a37a96d838b9
child 30356 c86109eface7
util: remove decompressors dict (API) All in-tree consumers are now using the compengines registrar. Extensions should switch to it as well.
mercurial/util.py
--- 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