##// END OF EJS Templates
verify: allow suppressing warnings about extra files...
Gregory Szorc -
r37435:76d2115c default
parent child Browse files
Show More
@@ -52,6 +52,7 b' class verifier(object):'
52 self.fncachewarned = False
52 self.fncachewarned = False
53 # developer config: verify.skipflags
53 # developer config: verify.skipflags
54 self.skipflags = repo.ui.configint('verify', 'skipflags')
54 self.skipflags = repo.ui.configint('verify', 'skipflags')
55 self.warnorphanstorefiles = True
55
56
56 def warn(self, msg):
57 def warn(self, msg):
57 self.ui.warn(msg + "\n")
58 self.ui.warn(msg + "\n")
@@ -294,8 +295,9 b' class verifier(object):'
294
295
295 if not dir and subdirnodes:
296 if not dir and subdirnodes:
296 ui.progress(_('checking'), None)
297 ui.progress(_('checking'), None)
297 for f in sorted(storefiles):
298 if self.warnorphanstorefiles:
298 self.warn(_("warning: orphan data file '%s'") % f)
299 for f in sorted(storefiles):
300 self.warn(_("warning: orphan data file '%s'") % f)
299
301
300 return filenodes
302 return filenodes
301
303
@@ -369,8 +371,10 b' class verifier(object):'
369 try:
371 try:
370 storefiles.remove(ff)
372 storefiles.remove(ff)
371 except KeyError:
373 except KeyError:
372 self.warn(_(" warning: revlog '%s' not in fncache!") % ff)
374 if self.warnorphanstorefiles:
373 self.fncachewarned = True
375 self.warn(_(" warning: revlog '%s' not in fncache!") %
376 ff)
377 self.fncachewarned = True
374
378
375 self.checklog(fl, f, lr)
379 self.checklog(fl, f, lr)
376 seen = {}
380 seen = {}
@@ -481,7 +485,8 b' class verifier(object):'
481 short(node), f)
485 short(node), f)
482 ui.progress(_('checking'), None)
486 ui.progress(_('checking'), None)
483
487
484 for f in sorted(storefiles):
488 if self.warnorphanstorefiles:
485 self.warn(_("warning: orphan data file '%s'") % f)
489 for f in sorted(storefiles):
490 self.warn(_("warning: orphan data file '%s'") % f)
486
491
487 return len(files), revisions
492 return len(files), revisions
@@ -35,6 +35,7 b' from mercurial import ('
35 pycompat,
35 pycompat,
36 revlog,
36 revlog,
37 store,
37 store,
38 verify,
38 )
39 )
39
40
40 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
41 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
@@ -656,9 +657,17 b' def makestore(orig, requirements, path, '
656
657
657 return simplestore(path, vfstype)
658 return simplestore(path, vfstype)
658
659
660 def verifierinit(orig, self, *args, **kwargs):
661 orig(self, *args, **kwargs)
662
663 # We don't care that files in the store don't align with what is
664 # advertised. So suppress these warnings.
665 self.warnorphanstorefiles = False
666
659 def extsetup(ui):
667 def extsetup(ui):
660 localrepo.featuresetupfuncs.add(featuresetup)
668 localrepo.featuresetupfuncs.add(featuresetup)
661
669
662 extensions.wrapfunction(localrepo, 'newreporequirements',
670 extensions.wrapfunction(localrepo, 'newreporequirements',
663 newreporequirements)
671 newreporequirements)
664 extensions.wrapfunction(store, 'store', makestore)
672 extensions.wrapfunction(store, 'store', makestore)
673 extensions.wrapfunction(verify.verifier, '__init__', verifierinit)
General Comments 0
You need to be logged in to leave comments. Login now