revlog: create a create `null_item` attribute for V0
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 04 May 2021 01:13:53 +0200
changeset 47247 ba21cfd9b044
parent 47246 02a4463565ea
child 47248 013c645dd28c
revlog: create a create `null_item` attribute for V0 This value is currently wrong, but at least it is now -obviously- wrong. Differential Revision: https://phab.mercurial-scm.org/D10644
mercurial/revlogutils/revlogv0.py
--- a/mercurial/revlogutils/revlogv0.py	Mon May 03 16:52:38 2021 +0200
+++ b/mercurial/revlogutils/revlogv0.py	Tue May 04 01:13:53 2021 +0200
@@ -42,6 +42,7 @@
 
 class revlogoldindex(list):
     entry_size = INDEX_ENTRY_V0.size
+    null_item = (0, 0, 0, -1, -1, -1, -1, node.nullid)
 
     @property
     def nodemap(self):
@@ -89,7 +90,7 @@
 
     def __getitem__(self, i):
         if i == -1:
-            return (0, 0, 0, -1, -1, -1, -1, node.nullid)
+            return self.null_item
         return list.__getitem__(self, i)
 
     def pack_header(self, header):