comparison mercurial/verify.py @ 44073:b9e174d4ed11

verify: allow the storage to signal when renames can be tested on `skipread` This applies the new marker in the lfs handler to show it in action, and adds the test mentioned at the beginning of the series to show that fulltext isn't necessary in the LFS case. The existing `skipread` isn't enough, because it is also set if an error occurs reading the revlog data, or the data is censored. It could probably be cleared, but then it technically violates the interface contract. That wouldn't matter for the existing verify algorithm, but it isn't clear how that will change as alternate storage support is added. The flag is probably pretty revlog specific, given the comments in verify.py. But there's already filelog specific stuff in there and I'm not sure what future storage will bring, so I don't want to over-engineer this. Likewise, I'm not sure that we want the verify method for each storage type to completely drive the bus when it comes to detecting renames, so I don't want to go down the rabbithole of having verifyintegrity() return metadata hints at this point. Differential Revision: https://phab.mercurial-scm.org/D7713
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 23 Dec 2019 01:12:20 -0500
parents a447efd991b9
children e77b57e09bfa
comparison
equal deleted inserted replaced
44072:1a6dd50cd0db 44073:b9e174d4ed11
527 if not len(fl) and (self.havecl or self.havemf): 527 if not len(fl) and (self.havecl or self.havemf):
528 self._err(lr, _(b"empty or missing %s") % f) 528 self._err(lr, _(b"empty or missing %s") % f)
529 else: 529 else:
530 # Guard against implementations not setting this. 530 # Guard against implementations not setting this.
531 state[b'skipread'] = set() 531 state[b'skipread'] = set()
532 state[b'safe_renamed'] = set()
533
532 for problem in fl.verifyintegrity(state): 534 for problem in fl.verifyintegrity(state):
533 if problem.node is not None: 535 if problem.node is not None:
534 linkrev = fl.linkrev(fl.rev(problem.node)) 536 linkrev = fl.linkrev(fl.rev(problem.node))
535 else: 537 else:
536 linkrev = None 538 linkrev = None
558 if havemf and n not in filenodes[f]: 560 if havemf and n not in filenodes[f]:
559 self._err(lr, _(b"%s not in manifests") % (short(n)), f) 561 self._err(lr, _(b"%s not in manifests") % (short(n)), f)
560 else: 562 else:
561 del filenodes[f][n] 563 del filenodes[f][n]
562 564
563 if n in state[b'skipread']: 565 if n in state[b'skipread'] and n not in state[b'safe_renamed']:
564 continue 566 continue
565 567
566 # check renames 568 # check renames
567 try: 569 try:
568 # This requires resolving fulltext (at least on revlogs, 570 # This requires resolving fulltext (at least on revlogs,