[Commented On] D10651: revlog: add a `_get_decompressor` method
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Wed May 5 21:50:54 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 27588.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10651?vs=27559&id=27588
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10651/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10651
AFFECTED FILES
mercurial/configitems.py
mercurial/revlog.py
CHANGE DETAILS
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -689,6 +689,20 @@
# revlog.target instead of using `self.radix`
return self.radix
+ def _get_decompressor(self, t):
+ try:
+ compressor = self._decompressors[t]
+ except KeyError:
+ try:
+ engine = util.compengines.forrevlogheader(t)
+ compressor = engine.revlogcompressor(self._compengineopts)
+ self._decompressors[t] = compressor
+ except KeyError:
+ raise error.RevlogError(
+ _(b'unknown compression type %s') % binascii.hexlify(t)
+ )
+ return compressor
+
@util.propertycache
def _compressor(self):
engine = util.compengines[self._compengine]
@@ -2375,17 +2389,7 @@
elif t == b'u':
return util.buffer(data, 1)
- try:
- compressor = self._decompressors[t]
- except KeyError:
- try:
- engine = util.compengines.forrevlogheader(t)
- compressor = engine.revlogcompressor(self._compengineopts)
- self._decompressors[t] = compressor
- except KeyError:
- raise error.RevlogError(
- _(b'unknown compression type %s') % binascii.hexlify(t)
- )
+ compressor = self._get_decompressor(t)
return compressor.decompress(data)
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -1158,7 +1158,8 @@
# * sidedata compression
# * introduce a proper solution to reduce the number of filelog related files.
# * Improvement to consider
-# - track compression mode in the index entris instead of the chunks
+# - avoid compression header in chunk using the default compression?
+# - forbid "inline" compression mode entirely?
# - split the data offset and flag field (the 2 bytes save are mostly trouble)
# - keep track of uncompressed -chunk- size (to preallocate memory better)
# - keep track of chain base or size (probably not that useful anymore)
To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210505/8b0be46c/attachment-0002.html>
More information about the Mercurial-patches
mailing list