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): |