comparison mercurial/verify.py @ 46895:6085b7f1536d

store: also return some information about the type of file `walk` found We start returning of 4th information in the `store.walk` return tuple: the type of the file. This will make it easier for caller to determine which kind of file they are looking at. This should especically help with the `upgrade-repo` code that has to do a lot of fragile index's file name comparison. Differential Revision: https://phab.mercurial-scm.org/D10315
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 06 Apr 2021 10:38:03 +0200
parents d4ba4d51f85f
children d55b71393907
comparison
equal deleted inserted replaced
46894:fe34c75f62ab 46895:6085b7f1536d
414 if not dir and subdirnodes: 414 if not dir and subdirnodes:
415 self.ui.status(_(b"checking directory manifests\n")) 415 self.ui.status(_(b"checking directory manifests\n"))
416 storefiles = set() 416 storefiles = set()
417 subdirs = set() 417 subdirs = set()
418 revlogv1 = self.revlogv1 418 revlogv1 = self.revlogv1
419 for f, f2, size in repo.store.datafiles(): 419 for t, f, f2, size in repo.store.datafiles():
420 if not f: 420 if not f:
421 self._err(None, _(b"cannot decode filename '%s'") % f2) 421 self._err(None, _(b"cannot decode filename '%s'") % f2)
422 elif (size > 0 or not revlogv1) and f.startswith(b'meta/'): 422 elif (size > 0 or not revlogv1) and f.startswith(b'meta/'):
423 storefiles.add(_normpath(f)) 423 storefiles.add(_normpath(f))
424 subdirs.add(os.path.dirname(f)) 424 subdirs.add(os.path.dirname(f))
478 revlogv1 = self.revlogv1 478 revlogv1 = self.revlogv1
479 havemf = self.havemf 479 havemf = self.havemf
480 ui.status(_(b"checking files\n")) 480 ui.status(_(b"checking files\n"))
481 481
482 storefiles = set() 482 storefiles = set()
483 for f, f2, size in repo.store.datafiles(): 483 for rl_type, f, f2, size in repo.store.datafiles():
484 if not f: 484 if not f:
485 self._err(None, _(b"cannot decode filename '%s'") % f2) 485 self._err(None, _(b"cannot decode filename '%s'") % f2)
486 elif (size > 0 or not revlogv1) and f.startswith(b'data/'): 486 elif (size > 0 or not revlogv1) and f.startswith(b'data/'):
487 storefiles.add(_normpath(f)) 487 storefiles.add(_normpath(f))
488 488