changeset 30365:c52faa621d9f

util: remove decompressors dict (API) All in-tree consumers are now using the compengines registrar. Extensions should switch to it as well.
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 07 Nov 2016 18:39:08 -0800
parents a37a96d838b9
children c86109eface7
files mercurial/util.py
diffstat 1 files changed, 0 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- 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