comparison mercurial/verify.py @ 50468:521fec115dad

store: use a StoreEntry object instead of tuple for store files We want to make the store return more semantic information instead of a stream of file path. To achieve this, we start with adding a simple object that hold the same information as the tuple it replace, and do a simple update to the user code to fetch and use the same information. From there, we will be able to iteratively upgrade the codebase toward better objects.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 08:56:23 +0200
parents d09a57ce6fc4
children 9fdc28e21b68
comparison
equal deleted inserted replaced
50467:814f55775b21 50468:521fec115dad
405 self.ui.status(_(b"checking directory manifests\n")) 405 self.ui.status(_(b"checking directory manifests\n"))
406 storefiles = set() 406 storefiles = set()
407 subdirs = set() 407 subdirs = set()
408 revlogv1 = self.revlogv1 408 revlogv1 = self.revlogv1
409 undecodable = [] 409 undecodable = []
410 for t, f, size in repo.store.datafiles(undecodable=undecodable): 410 for entry in repo.store.datafiles(undecodable=undecodable):
411 f = entry.unencoded_path
412 size = entry.file_size
411 if (size > 0 or not revlogv1) and f.startswith(b'meta/'): 413 if (size > 0 or not revlogv1) and f.startswith(b'meta/'):
412 storefiles.add(_normpath(f)) 414 storefiles.add(_normpath(f))
413 subdirs.add(os.path.dirname(f)) 415 subdirs.add(os.path.dirname(f))
414 for f in undecodable: 416 for f in undecodable:
415 self._err(None, _(b"cannot decode filename '%s'") % f) 417 self._err(None, _(b"cannot decode filename '%s'") % f)
470 havemf = self.havemf 472 havemf = self.havemf
471 ui.status(_(b"checking files\n")) 473 ui.status(_(b"checking files\n"))
472 474
473 storefiles = set() 475 storefiles = set()
474 undecodable = [] 476 undecodable = []
475 for t, f, size in repo.store.datafiles(undecodable=undecodable): 477 for entry in repo.store.datafiles(undecodable=undecodable):
478 size = entry.file_size
479 f = entry.unencoded_path
476 if (size > 0 or not revlogv1) and f.startswith(b'data/'): 480 if (size > 0 or not revlogv1) and f.startswith(b'data/'):
477 storefiles.add(_normpath(f)) 481 storefiles.add(_normpath(f))
478 for f in undecodable: 482 for f in undecodable:
479 self._err(None, _(b"cannot decode filename '%s'") % f) 483 self._err(None, _(b"cannot decode filename '%s'") % f)
480 484