Show More
@@ -49,6 +49,8 b' class verifier(object):' | |||
|
49 | 49 | self.lrugetctx = util.lrucachefunc(repo.changectx) |
|
50 | 50 | self.refersmf = False |
|
51 | 51 | self.fncachewarned = False |
|
52 | # developer config: verify.skipflags | |
|
53 | self.skipflags = repo.ui.configint('verify', 'skipflags') | |
|
52 | 54 | |
|
53 | 55 | def warn(self, msg): |
|
54 | 56 | self.ui.warn(msg + "\n") |
@@ -427,6 +429,10 b' class verifier(object):' | |||
|
427 | 429 | # 2. hash check: depending on flag processor, we may need to |
|
428 | 430 | # use either "text" (external), or "rawtext" (in revlog). |
|
429 | 431 | try: |
|
432 | skipflags = self.skipflags | |
|
433 | if skipflags: | |
|
434 | skipflags &= fl.flags(i) | |
|
435 | if not skipflags: | |
|
430 | 436 | fl.read(n) # side effect: read content and do checkhash |
|
431 | 437 | rp = fl.renamed(n) |
|
432 | 438 | # the "L1 == L2" check |
@@ -317,3 +317,47 b' test revlog format 0' | |||
|
317 | 317 | checking files |
|
318 | 318 | 1 files, 1 changesets, 1 total revisions |
|
319 | 319 | $ cd .. |
|
320 | ||
|
321 | test flag processor and skipflags | |
|
322 | ||
|
323 | $ hg init skipflags | |
|
324 | $ cd skipflags | |
|
325 | $ cat >> .hg/hgrc <<EOF | |
|
326 | > [extensions] | |
|
327 | > flagprocesor=$RUNTESTDIR/flagprocessorext.py | |
|
328 | > EOF | |
|
329 | $ echo '[BASE64]content' > base64 | |
|
330 | $ hg commit -Aqm 'flag processor content' base64 | |
|
331 | $ hg verify | |
|
332 | checking changesets | |
|
333 | checking manifests | |
|
334 | crosschecking files in changesets and manifests | |
|
335 | checking files | |
|
336 | 1 files, 1 changesets, 1 total revisions | |
|
337 | ||
|
338 | $ cat >> $TESTTMP/break-base64.py <<EOF | |
|
339 | > from __future__ import absolute_import | |
|
340 | > import base64 | |
|
341 | > base64.b64decode=lambda x: x | |
|
342 | > EOF | |
|
343 | $ cat >> .hg/hgrc <<EOF | |
|
344 | > breakbase64=$TESTTMP/break-base64.py | |
|
345 | > EOF | |
|
346 | ||
|
347 | $ hg verify | |
|
348 | checking changesets | |
|
349 | checking manifests | |
|
350 | crosschecking files in changesets and manifests | |
|
351 | checking files | |
|
352 | base64@0: unpacking 794cee7777cb: integrity check failed on data/base64.i:0 | |
|
353 | 1 files, 1 changesets, 1 total revisions | |
|
354 | 1 integrity errors encountered! | |
|
355 | (first damaged changeset appears to be 0) | |
|
356 | [1] | |
|
357 | $ hg verify --config verify.skipflags=2147483647 | |
|
358 | checking changesets | |
|
359 | checking manifests | |
|
360 | crosschecking files in changesets and manifests | |
|
361 | checking files | |
|
362 | 1 files, 1 changesets, 1 total revisions | |
|
363 |
General Comments 0
You need to be logged in to leave comments.
Login now