diff -r 7a0ec25d5836 -r ac60a1366a49 mercurial/revlogutils/__init__.py --- 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)