mercurial/pure/parsers.py
changeset 47394 ac60a1366a49
parent 47270 25ce16bf724b
child 47490 084ed6a7c6fd
--- a/mercurial/pure/parsers.py	Sat May 22 00:06:22 2021 +0200
+++ b/mercurial/pure/parsers.py	Sun May 30 16:19:36 2021 +0200
@@ -17,6 +17,7 @@
 from .. import (
     error,
     pycompat,
+    revlogutils,
     util,
 )
 
@@ -42,10 +43,6 @@
     return int(q & 0xFFFF)
 
 
-def offset_type(offset, type):
-    return int(int(offset) << 16 | type)
-
-
 class BaseIndexObject(object):
     # Can I be passed to an algorithme implemented in Rust ?
     rust_ext_compat = 0
@@ -145,7 +142,8 @@
             data = self._data[index : index + self.entry_size]
         r = self._unpack_entry(i, data)
         if self._lgt and i == 0:
-            r = (offset_type(0, gettype(r[0])),) + r[1:]
+            offset = revlogutils.offset_type(0, gettype(r[0]))
+            r = (offset,) + r[1:]
         return r
 
     def _unpack_entry(self, rev, data):