comparison mercurial/verify.py @ 39845:e6d3d39cc1c7

revlog: use proper version comparison during verify Verify appears to want to compare the changelog's revlog version number with the version number of filelogs and error if they are different. But what it was actually doing was comparing the full 32-bit header integer, which contains 2 shorts: 1 for the revlog version number and 1 for feature flags. This commit tweaks the verification code so it only looks at the version number component of the header and emits a warning if they differ. The new code is more robust because it accounts for future revlog version numbers without them needing to be special cased. Differential Revision: https://phab.mercurial-scm.org/D4704
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 19 Sep 2018 11:38:05 -0700
parents 97986c9c69d3
children 733db72f0f54
comparison
equal deleted inserted replaced
39844:0cb3e02e1d1b 39845:e6d3d39cc1c7
340 self.err(None, _("cannot decode filename '%s'") % f2) 340 self.err(None, _("cannot decode filename '%s'") % f2)
341 elif (size > 0 or not revlogv1) and f.startswith('data/'): 341 elif (size > 0 or not revlogv1) and f.startswith('data/'):
342 storefiles.add(_normpath(f)) 342 storefiles.add(_normpath(f))
343 343
344 state = { 344 state = {
345 'revlogv1': self.revlogv1, 345 # TODO this assumes revlog storage for changelog.
346 'expectedversion': self.repo.changelog.version & 0xFFFF
346 } 347 }
347 348
348 files = sorted(set(filenodes) | set(filelinkrevs)) 349 files = sorted(set(filenodes) | set(filelinkrevs))
349 revisions = 0 350 revisions = 0
350 progress = ui.makeprogress(_('checking'), unit=_('files'), 351 progress = ui.makeprogress(_('checking'), unit=_('files'),