Mercurial > public > mercurial-scm > hg-stable
diff mercurial/pure/parsers.py @ 48537:c5d6c874766a
rank: actually persist revision's rank in changelog-v2
The changelog v2 format is now persisting whatever "rank" value is recorded.
However keep in mind that for we do not record any value.
Differential Revision: https://phab.mercurial-scm.org/D11937
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 15 Dec 2021 15:28:41 +0100 |
parents | 52034c42c09d |
children | c514936d92b4 |
line wrap: on
line diff
--- a/mercurial/pure/parsers.py Tue Dec 14 23:56:38 2021 +0100 +++ b/mercurial/pure/parsers.py Wed Dec 15 15:28:41 2021 +0100 @@ -880,6 +880,12 @@ class IndexChangelogV2(IndexObject2): index_format = revlog_constants.INDEX_ENTRY_CL_V2 + null_item = ( + IndexObject2.null_item[: revlog_constants.ENTRY_RANK] + + (0,) # rank of null is 0 + + IndexObject2.null_item[revlog_constants.ENTRY_RANK :] + ) + def _unpack_entry(self, rev, data, r=True): items = self.index_format.unpack(data) return ( @@ -898,7 +904,7 @@ items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] & 3, (items[revlog_constants.INDEX_ENTRY_V2_IDX_COMPRESSION_MODE] >> 2) & 3, - revlog_constants.RANK_UNKNOWN, + items[revlog_constants.INDEX_ENTRY_V2_IDX_RANK], ) def _pack_entry(self, rev, entry): @@ -919,6 +925,7 @@ entry[revlog_constants.ENTRY_DATA_COMPRESSION_MODE] & 3 | (entry[revlog_constants.ENTRY_SIDEDATA_COMPRESSION_MODE] & 3) << 2, + entry[revlog_constants.ENTRY_RANK], ) return self.index_format.pack(*data)