##// END OF EJS Templates
revlog: move `offset_type` to `revlogutils`...
revlog: move `offset_type` to `revlogutils` This multiple module are using this so it make sense to move it at the utility level. Differential Revision: https://phab.mercurial-scm.org/D10792

File last commit:

r48186:ac60a136 default
r48186:ac60a136 default
Show More
__init__.py
16 lines | 533 B | text/x-python | PythonLexer
# mercurial.revlogutils -- basic utilities for revlog
#
# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net>
#
# This software may be used and distributed according to the terms of the
# 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)