comparison mercurial/repair.py @ 50471: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 c5e93c915ab6
children 92611344aec2
comparison
equal deleted inserted replaced
50470:814f55775b21 50471:521fec115dad
442 def manifestrevlogs(repo): 442 def manifestrevlogs(repo):
443 yield repo.manifestlog.getstorage(b'') 443 yield repo.manifestlog.getstorage(b'')
444 if scmutil.istreemanifest(repo): 444 if scmutil.istreemanifest(repo):
445 # This logic is safe if treemanifest isn't enabled, but also 445 # This logic is safe if treemanifest isn't enabled, but also
446 # pointless, so we skip it if treemanifest isn't enabled. 446 # pointless, so we skip it if treemanifest isn't enabled.
447 for t, unencoded, size in repo.store.datafiles(): 447 for entry in repo.store.datafiles():
448 unencoded = entry.unencoded_path
449 # XXX use the entry.revlog_type instead
448 if unencoded.startswith(b'meta/') and unencoded.endswith( 450 if unencoded.startswith(b'meta/') and unencoded.endswith(
449 b'00manifest.i' 451 b'00manifest.i'
450 ): 452 ):
451 dir = unencoded[5:-12] 453 dir = unencoded[5:-12]
452 yield repo.manifestlog.getstorage(dir) 454 yield repo.manifestlog.getstorage(dir)