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

login
register
mail settings
Submitter Gregory Szorc
Date Nov. 2, 2016, 12:08 a.m.
Message ID <b32a9f8f72bcaea41d23.1478045317@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/17247/
State Superseded
Headers show

Comments

Gregory Szorc - Nov. 2, 2016, 12:08 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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