comparison mercurial/changelog.py @ 47139:f58a13c52726

revlog: split the `version` attribute into its two components The `revlog.version` attribute contained an integer coding 2 different informations: * the revlog version number * a bit field defining some specific feature of the revlog We now explicitly store the two components independently. This avoid exposing the implementation details all around the code and prepare for future revlog version that would encode the information in a different way. In the process we drop the `version` attribute from the interface. It was flagged for removal when that interface was created. Differential Revision: https://phab.mercurial-scm.org/D10565
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:20:45 +0200
parents 64cd1496bb70
children c6b8d5d91e73
comparison
equal deleted inserted replaced
47138:bc138f2a2e47 47139:f58a13c52726
411 mmaplargeindex=True, 411 mmaplargeindex=True,
412 persistentnodemap=opener.options.get(b'persistent-nodemap', False), 412 persistentnodemap=opener.options.get(b'persistent-nodemap', False),
413 concurrencychecker=concurrencychecker, 413 concurrencychecker=concurrencychecker,
414 ) 414 )
415 415
416 if self._initempty and (self.version & 0xFFFF == revlog.REVLOGV1): 416 if self._initempty and (self._format_version == revlog.REVLOGV1):
417 # changelogs don't benefit from generaldelta. 417 # changelogs don't benefit from generaldelta.
418 418
419 self.version &= ~revlog.FLAG_GENERALDELTA 419 self._format_flags &= ~revlog.FLAG_GENERALDELTA
420 self._generaldelta = False 420 self._generaldelta = False
421 421
422 # Delta chains for changelogs tend to be very small because entries 422 # Delta chains for changelogs tend to be very small because entries
423 # tend to be small and don't delta well with each. So disable delta 423 # tend to be small and don't delta well with each. So disable delta
424 # chains. 424 # chains.