mercurial/revlogutils/__init__.py
changeset 47394 ac60a1366a49
parent 44034 ab595920de0e
child 47395 a669404f0f4a
--- a/mercurial/revlogutils/__init__.py	Sat May 22 00:06:22 2021 +0200
+++ b/mercurial/revlogutils/__init__.py	Sun May 30 16:19:36 2021 +0200
@@ -6,3 +6,11 @@
 # GNU General Public License version 2 or any later version.
 
 from __future__ import absolute_import
+
+from ..interfaces import repository
+
+
+def offset_type(offset, type):
+    if (type & ~repository.REVISION_FLAGS_KNOWN) != 0:
+        raise ValueError(b'unknown revlog index flags: %d' % type)
+    return int(int(offset) << 16 | type)