mercurial/pure/parsers.py
changeset 46857 cc65cea90edb
parent 46819 d4ba4d51f85f
child 46858 85e3a630cad9
equal deleted inserted replaced
46856:34e1fa4b548a 46857:cc65cea90edb
    15     pycompat,
    15     pycompat,
    16     util,
    16     util,
    17 )
    17 )
    18 
    18 
    19 from ..revlogutils import nodemap as nodemaputil
    19 from ..revlogutils import nodemap as nodemaputil
       
    20 from ..revlogutils import constants as revlog_constants
    20 
    21 
    21 stringio = pycompat.bytesio
    22 stringio = pycompat.bytesio
    22 
    23 
    23 
    24 
    24 _pack = struct.pack
    25 _pack = struct.pack
    41     return int(int(offset) << 16 | type)
    42     return int(int(offset) << 16 | type)
    42 
    43 
    43 
    44 
    44 class BaseIndexObject(object):
    45 class BaseIndexObject(object):
    45     # Format of an index entry according to Python's `struct` language
    46     # Format of an index entry according to Python's `struct` language
    46     index_format = b">Qiiiiii20s12x"
    47     index_format = revlog_constants.INDEX_ENTRY_V1.format
    47     # Size of a C unsigned long long int, platform independent
    48     # Size of a C unsigned long long int, platform independent
    48     big_int_size = struct.calcsize(b'>Q')
    49     big_int_size = struct.calcsize(b'>Q')
    49     # Size of a C long int, platform independent
    50     # Size of a C long int, platform independent
    50     int_size = struct.calcsize(b'>i')
    51     int_size = struct.calcsize(b'>i')
    51     # Size of the entire index format
    52     # Size of the entire index format
    52     index_size = struct.calcsize(index_format)
    53     index_size = revlog_constants.INDEX_ENTRY_V1.size
    53     # An empty index entry, used as a default value to be overridden, or nullrev
    54     # An empty index entry, used as a default value to be overridden, or nullrev
    54     null_item = (0, 0, 0, -1, -1, -1, -1, nullid)
    55     null_item = (0, 0, 0, -1, -1, -1, -1, nullid)
    55 
    56 
    56     @property
    57     @property
    57     def nodemap(self):
    58     def nodemap(self):