diff mercurial/pure/parsers.py @ 47143:47ffc754989a

revlog: always "append" full size tuple Same reasoning as the previous patch. Differential Revision: https://phab.mercurial-scm.org/D10569
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:21:25 +0200
parents 4292bed8da7c
children 6b1eae313b2f
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Mon May 03 12:21:15 2021 +0200
+++ b/mercurial/pure/parsers.py	Mon May 03 12:21:25 2021 +0200
@@ -104,9 +104,14 @@
     def append(self, tup):
         if '_nodemap' in vars(self):
             self._nodemap[tup[7]] = len(self)
-        data = self.index_format.pack(*tup)
+        data = self._pack_entry(tup)
         self._extra.append(data)
 
+    def _pack_entry(self, entry):
+        assert entry[8] == 0
+        assert entry[9] == 0
+        return self.index_format.pack(*entry[:8])
+
     def _check_index(self, i):
         if not isinstance(i, int):
             raise TypeError(b"expecting int indexes")
@@ -299,6 +304,9 @@
     def _unpack_entry(self, data):
         return self.index_format.unpack(data)
 
+    def _pack_entry(self, entry):
+        return self.index_format.pack(*entry)
+
     def entry_binary(self, rev):
         """return the raw binary string representing a revision"""
         entry = self[rev]