[PATCH 04 of 11] util: remove compressors dict (API)

Gregory Szorc gregory.szorc at gmail.com
Tue Nov 1 20:08:37 EDT 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1477155531 25200
#      Sat Oct 22 09:58:51 2016 -0700
# Node ID b32a9f8f72bcaea41d23165cc26583b0dcfb0fc6
# Parent  5ebb7422896689850acba2017f61c182050956d0
util: remove compressors dict (API)

We no longer have any in-tree consumers of this object. Use
util.compressionengines instead.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2992,25 +2992,16 @@ class _noopengine(object):
     def compressorobj(self):
         return nocompress()
 
     def decompressorreader(self, fh):
         return fh
 
 compressionengines.register('none', _noopengine())
 
-compressors = {
-    None: nocompress,
-    # lambda to prevent early import
-    'BZ': lambda: bz2.BZ2Compressor(),
-    'GZ': lambda: zlib.compressobj(),
-    }
-# also support the old form by courtesies
-compressors['UN'] = compressors[None]
-
 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


More information about the Mercurial-devel mailing list