Show More
@@ -880,18 +880,43 b' class IndexChangelogV2(IndexObject2):' | |||
|
880 | 880 | |
|
881 | 881 | def _unpack_entry(self, rev, data, r=True): |
|
882 | 882 | items = self.index_format.unpack(data) |
|
883 | entry = items[:3] + (rev, rev) + items[3:8] | |
|
884 | data_comp = items[8] & 3 | |
|
885 | sidedata_comp = (items[8] >> 2) & 3 | |
|
886 | return entry + (data_comp, sidedata_comp) | |
|
883 | return ( | |
|
884 | items[revlog_constants.INDEX_ENTRY_V2_IDX_OFFSET], | |
|
885 | items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSED_LENGTH], | |
|
886 | items[revlog_constants.INDEX_ENTRY_V2_IDX_UNCOMPRESSED_LENGTH], | |
|
887 | rev, | |
|
888 | rev, | |
|
889 | items[revlog_constants.INDEX_ENTRY_V2_IDX_PARENT_1], | |
|
890 | items[revlog_constants.INDEX_ENTRY_V2_IDX_PARENT_2], | |
|
891 | items[revlog_constants.INDEX_ENTRY_V2_IDX_NODEID], | |
|
892 | items[revlog_constants.INDEX_ENTRY_V2_IDX_SIDEDATA_OFFSET], | |
|
893 | items[ | |
|
894 | revlog_constants.INDEX_ENTRY_V2_IDX_SIDEDATA_COMPRESSED_LENGTH | |
|
895 | ], | |
|
896 | items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] & 3, | |
|
897 | (items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] >> 2) | |
|
898 | & 3, | |
|
899 | ) | |
|
887 | 900 | |
|
888 | 901 | def _pack_entry(self, rev, entry): |
|
889 | assert entry[3] == rev, entry[3] | |
|
890 | assert entry[4] == rev, entry[4] | |
|
891 | data = entry[:3] + entry[5:10] | |
|
892 | data_comp = entry[10] & 3 | |
|
893 | sidedata_comp = (entry[11] & 3) << 2 | |
|
894 | data += (data_comp | sidedata_comp,) | |
|
902 | ||
|
903 | base = entry[revlog_constants.ENTRY_DELTA_BASE] | |
|
904 | link_rev = entry[revlog_constants.ENTRY_LINK_REV] | |
|
905 | assert base == rev, (base, rev) | |
|
906 | assert link_rev == rev, (link_rev, rev) | |
|
907 | data = ( | |
|
908 | entry[revlog_constants.ENTRY_DATA_OFFSET], | |
|
909 | entry[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH], | |
|
910 | entry[revlog_constants.ENTRY_DATA_UNCOMPRESSED_LENGTH], | |
|
911 | entry[revlog_constants.ENTRY_PARENT_1], | |
|
912 | entry[revlog_constants.ENTRY_PARENT_2], | |
|
913 | entry[revlog_constants.ENTRY_NODE_ID], | |
|
914 | entry[revlog_constants.ENTRY_SIDEDATA_OFFSET], | |
|
915 | entry[revlog_constants.ENTRY_SIDEDATA_COMPRESSED_LENGTH], | |
|
916 | entry[revlog_constants.ENTRY_DATA_COMPRESSION_MODE] & 3 | |
|
917 | | (entry[revlog_constants.ENTRY_SIDEDATA_COMPRESSION_MODE] & 3) | |
|
918 | << 2, | |
|
919 | ) | |
|
895 | 920 | return self.index_format.pack(*data) |
|
896 | 921 | |
|
897 | 922 |
@@ -184,6 +184,15 b' assert INDEX_ENTRY_V2.size == 32 * 3, IN' | |||
|
184 | 184 | # 27 bytes: Padding to align to 96 bytes (see RevlogV2Plan wiki page) |
|
185 | 185 | INDEX_ENTRY_CL_V2 = struct.Struct(b">Qiiii20s12xQiB27x") |
|
186 | 186 | assert INDEX_ENTRY_CL_V2.size == 32 * 3, INDEX_ENTRY_V2.size |
|
187 | INDEX_ENTRY_V2_IDX_OFFSET = 0 | |
|
188 | INDEX_ENTRY_V2_IDX_COMPRESSED_LENGTH = 1 | |
|
189 | INDEX_ENTRY_V2_IDX_UNCOMPRESSED_LENGTH = 2 | |
|
190 | INDEX_ENTRY_V2_IDX_PARENT_1 = 3 | |
|
191 | INDEX_ENTRY_V2_IDX_PARENT_2 = 4 | |
|
192 | INDEX_ENTRY_V2_IDX_NODEID = 5 | |
|
193 | INDEX_ENTRY_V2_IDX_SIDEDATA_OFFSET = 6 | |
|
194 | INDEX_ENTRY_V2_IDX_SIDEDATA_COMPRESSED_LENGTH = 7 | |
|
195 | INDEX_ENTRY_V2_IDX_COMPRESSION_MODE = 8 | |
|
187 | 196 | |
|
188 | 197 | # revlog index flags |
|
189 | 198 |
General Comments 0
You need to be logged in to leave comments.
Login now