Mercurial > hg
diff hgext/remotefilelog/debugcommands.py @ 40507:e2a1584e9e3f
remotefilelog: rip out lz4 support
Some methods are left teased out so it's easier to build a migration
extension from v1 packs to v2. I also anticipate those methods will be
of use if we get around to adding configurable compression engines
before we end up jettisoning packs.
I think it would make sense to register one-shot `compress` and
`decompress` methods on our compression engines in util.py, but
indygreg mentioned that might not be straightforward.
Differential Revision: https://phab.mercurial-scm.org/D4944
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 04 Oct 2018 00:11:37 -0400 |
parents | 3a333a582d7b |
children | fc2766860796 |
line wrap: on
line diff
--- a/hgext/remotefilelog/debugcommands.py Wed Oct 03 23:25:31 2018 -0400 +++ b/hgext/remotefilelog/debugcommands.py Thu Oct 04 00:11:37 2018 -0400 @@ -8,6 +8,7 @@ import hashlib import os +import zlib from mercurial.node import bin, hex, nullid, short from mercurial.i18n import _ @@ -22,7 +23,6 @@ extutil, fileserverclient, historypack, - lz4wrapper, repack, shallowrepo, shallowutil, @@ -171,6 +171,9 @@ ui.status("%s %s\n" % (key, os.path.relpath(filepath, path))) +def _decompressblob(raw): + return zlib.decompress(raw) + def parsefileblob(path, decompress): raw = None f = open(path, "r") @@ -180,7 +183,7 @@ f.close() if decompress: - raw = lz4wrapper.lz4decompress(raw) + raw = _decompressblob(raw) offset, size, flags = shallowutil.parsesizeflags(raw) start = offset + size