Mercurial > public > mercurial-scm > hg-stable
diff mercurial/verify.py @ 47153: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 | bc138f2a2e47 |
children | 5ed2aaab58b0 |
line wrap: on
line diff
--- a/mercurial/verify.py Mon May 03 12:20:35 2021 +0200 +++ b/mercurial/verify.py Mon May 03 12:20:45 2021 +0200 @@ -51,7 +51,7 @@ self.warnings = 0 self.havecl = len(repo.changelog) > 0 self.havemf = len(repo.manifestlog.getstorage(b'')) > 0 - self.revlogv1 = repo.changelog.version != revlog.REVLOGV0 + self.revlogv1 = repo.changelog._format_version != revlog.REVLOGV0 self.lrugetctx = util.lrucachefunc(repo.unfiltered().__getitem__) self.refersmf = False self.fncachewarned = False @@ -102,7 +102,7 @@ if d[1]: self._err(None, _(b"index contains %d extra bytes") % d[1], name) - if obj.version != revlog.REVLOGV0: + if obj._format_version != revlog.REVLOGV0: if not self.revlogv1: self._warn(_(b"warning: `%s' uses revlog format 1") % name) elif self.revlogv1: @@ -483,7 +483,7 @@ state = { # TODO this assumes revlog storage for changelog. - b'expectedversion': self.repo.changelog.version & 0xFFFF, + b'expectedversion': self.repo.changelog._format_version, b'skipflags': self.skipflags, # experimental config: censor.policy b'erroroncensored': ui.config(b'censor', b'policy') == b'abort',