Patchwork D10659: revlogv2: drop the code related to inlined revlogv2

login
register
mail settings
Submitter phabricator
Date May 4, 2021, 2:20 p.m.
Message ID <differential-rev-PHID-DREV-ek2qvryzfrqf3z7wp35b-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48975/
State Superseded
Headers show

Comments

phabricator - May 4, 2021, 2:20 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Tevlogv2 will not use inlined revlog. As a result we can drop the associated
  code.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10659

AFFECTED FILES
  mercurial/pure/parsers.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -289,11 +289,11 @@ 
     if not inline:
         cls = IndexObject2 if revlogv2 else IndexObject
         return cls(data), None
-    cls = InlinedIndexObject2 if revlogv2 else InlinedIndexObject
+    cls = InlinedIndexObject
     return cls(data, inline), (0, data)
 
 
-class Index2Mixin(object):
+class IndexObject2(IndexObject):
     index_format = revlog_constants.INDEX_ENTRY_V2
 
     def replace_sidedata_info(
@@ -353,36 +353,6 @@ 
         raise error.ProgrammingError(msg)
 
 
-class IndexObject2(Index2Mixin, IndexObject):
-    pass
-
-
-class InlinedIndexObject2(Index2Mixin, InlinedIndexObject):
-    def _inline_scan(self, lgt):
-        sidedata_length_pos = 72
-        off = 0
-        if lgt is not None:
-            self._offsets = [0] * lgt
-        count = 0
-        while off <= len(self._data) - self.entry_size:
-            start = off + self.big_int_size
-            (data_size,) = struct.unpack(
-                b'>i',
-                self._data[start : start + self.int_size],
-            )
-            start = off + sidedata_length_pos
-            (side_data_size,) = struct.unpack(
-                b'>i', self._data[start : start + self.int_size]
-            )
-            if lgt is not None:
-                self._offsets[count] = off
-            count += 1
-            off += self.entry_size + data_size + side_data_size
-        if off != len(self._data):
-            raise ValueError(b"corrupted data")
-        return count
-
-
 def parse_index_devel_nodemap(data, inline):
     """like parse_index2, but alway return a PersistentNodeMapIndexObject"""
     return PersistentNodeMapIndexObject(data), None