Mercurial > hg
comparison tests/test-verify.t @ 32288:a2ab9ebcd85b
verify: add a config option to skip certain flag processors
Previously, "hg verify" verifies everything, which could be undesirable when
there are expensive flag processor contents.
This patch adds a "verify.skipflags" developer config. A flag processor will
be skipped if (flag & verify.skipflags) == 0.
In the LFS usecase, that means "hg verify --config verify.skipflags=8192"
will not download all LFS blobs, which could be too large to be stored
locally.
Note: "renamed" is also skipped since its default implementation may call
filelog.data() which will trigger the flag processor.
author | Jun Wu <quark@fb.com> |
---|---|
date | Sun, 14 May 2017 09:38:06 -0700 |
parents | c059286a0f9c |
children | b6612d8579e4 |
comparison
equal
deleted
inserted
replaced
32287:df3cf9422e1b | 32288:a2ab9ebcd85b |
---|---|
315 checking manifests | 315 checking manifests |
316 crosschecking files in changesets and manifests | 316 crosschecking files in changesets and manifests |
317 checking files | 317 checking files |
318 1 files, 1 changesets, 1 total revisions | 318 1 files, 1 changesets, 1 total revisions |
319 $ cd .. | 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 |