##// END OF EJS Templates
rank: actually persist revision's rank in changelog-v2...
marmoute -
r49331:c5d6c874 default
parent child Browse files
Show More
@@ -1357,10 +1357,10 b' coreconfigitem('
1357 1357 )
1358 1358 # Experimental TODOs:
1359 1359 #
1360 # * Same as for evlogv2 (but for the reduction of the number of files)
1360 # * Same as for revlogv2 (but for the reduction of the number of files)
1361 # * Actually computing the rank of changesets
1361 1362 # * Improvement to investigate
1362 1363 # - storing .hgtags fnode
1363 # - storing `rank` of changesets
1364 1364 # - storing branch related identifier
1365 1365
1366 1366 coreconfigitem(
@@ -880,6 +880,12 b' class IndexObject2(IndexObject):'
880 880 class IndexChangelogV2(IndexObject2):
881 881 index_format = revlog_constants.INDEX_ENTRY_CL_V2
882 882
883 null_item = (
884 IndexObject2.null_item[: revlog_constants.ENTRY_RANK]
885 + (0,) # rank of null is 0
886 + IndexObject2.null_item[revlog_constants.ENTRY_RANK :]
887 )
888
883 889 def _unpack_entry(self, rev, data, r=True):
884 890 items = self.index_format.unpack(data)
885 891 return (
@@ -898,7 +904,7 b' class IndexChangelogV2(IndexObject2):'
898 904 items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] & 3,
899 905 (items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] >> 2)
900 906 & 3,
901 revlog_constants.RANK_UNKNOWN,
907 items[revlog_constants.INDEX_ENTRY_V2_IDX_RANK],
902 908 )
903 909
904 910 def _pack_entry(self, rev, entry):
@@ -919,6 +925,7 b' class IndexChangelogV2(IndexObject2):'
919 925 entry[revlog_constants.ENTRY_DATA_COMPRESSION_MODE] & 3
920 926 | (entry[revlog_constants.ENTRY_SIDEDATA_COMPRESSION_MODE] & 3)
921 927 << 2,
928 entry[revlog_constants.ENTRY_RANK],
922 929 )
923 930 return self.index_format.pack(*data)
924 931
@@ -192,8 +192,9 b' assert INDEX_ENTRY_V2.size == 32 * 3, IN'
192 192 # 8 bytes: sidedata offset
193 193 # 4 bytes: sidedata compressed length
194 194 # 1 bytes: compression mode (2 lower bit are data_compression_mode)
195 # 27 bytes: Padding to align to 96 bytes (see RevlogV2Plan wiki page)
196 INDEX_ENTRY_CL_V2 = struct.Struct(b">Qiiii20s12xQiB27x")
195 # 4 bytes: changeset rank (i.e. `len(::REV)`)
196 # 23 bytes: Padding to align to 96 bytes (see RevlogV2Plan wiki page)
197 INDEX_ENTRY_CL_V2 = struct.Struct(b">Qiiii20s12xQiBi23x")
197 198 assert INDEX_ENTRY_CL_V2.size == 32 * 3, INDEX_ENTRY_CL_V2.size
198 199 INDEX_ENTRY_V2_IDX_OFFSET = 0
199 200 INDEX_ENTRY_V2_IDX_COMPRESSED_LENGTH = 1
@@ -204,6 +205,7 b' INDEX_ENTRY_V2_IDX_NODEID = 5'
204 205 INDEX_ENTRY_V2_IDX_SIDEDATA_OFFSET = 6
205 206 INDEX_ENTRY_V2_IDX_SIDEDATA_COMPRESSED_LENGTH = 7
206 207 INDEX_ENTRY_V2_IDX_COMPRESSION_MODE = 8
208 INDEX_ENTRY_V2_IDX_RANK = 9
207 209
208 210 # revlog index flags
209 211
General Comments 0
You need to be logged in to leave comments. Login now