[PATCH] verify: clarify misleading fncache message

Adrian Buehlmann adrian at cadifra.com
Fri Jun 19 12:58:56 CDT 2015


On 2015-06-19 19:00, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm at selenic.com>
> # Date 1434733206 18000
> #      Fri Jun 19 12:00:06 2015 -0500
> # Node ID c1ad1589a44b519411b6f209c1e81322f4ccfd4e
> # Parent  85294076adceb3263056e366023cba2e88ace6ca
> verify: clarify misleading fncache message
> 
> This is a message about cache corruption, not repository corruption or
> actually missing files. Fix message and reduce to a warning.
> 
> diff -r 85294076adce -r c1ad1589a44b mercurial/verify.py
> --- a/mercurial/verify.py	Wed Jun 10 19:18:51 2015 -0700
> +++ b/mercurial/verify.py	Fri Jun 19 12:00:06 2015 -0500
> @@ -244,7 +244,7 @@
>              try:
>                  storefiles.remove(ff)
>              except KeyError:
> -                err(lr, _("missing revlog!"), ff)
> +                warn(_(" warning: revlog '%s' not in fncache!") % ff)
>  
>          checklog(fl, f, lr)
>          seen = {}
> diff -r 85294076adce -r c1ad1589a44b tests/test-fncache.t
> --- a/tests/test-fncache.t	Wed Jun 10 19:18:51 2015 -0700
> +++ b/tests/test-fncache.t	Fri Jun 19 12:00:06 2015 -0500
> @@ -48,13 +48,11 @@
>    checking manifests
>    crosschecking files in changesets and manifests
>    checking files
> -   data/a.i at 0: missing revlog!
> -   data/a.i.hg/c.i at 2: missing revlog!
> -   data/a.i/b.i at 1: missing revlog!
> +   warning: revlog 'data/a.i' not in fncache!
> +   warning: revlog 'data/a.i.hg/c.i' not in fncache!
> +   warning: revlog 'data/a.i/b.i' not in fncache!
>    3 files, 3 changesets, 3 total revisions
> -  3 integrity errors encountered!
> -  (first damaged changeset appears to be 0)
> -  [1]
> +  3 warnings encountered!
>    $ cd ..
>  
>  Non store repo:
> diff -r 85294076adce -r c1ad1589a44b tests/test-verify.t
> --- a/tests/test-verify.t	Wed Jun 10 19:18:51 2015 -0700
> +++ b/tests/test-verify.t	Fri Jun 19 12:00:06 2015 -0500
> @@ -44,17 +44,18 @@
>    checking manifests
>    crosschecking files in changesets and manifests
>    checking files
> -   data/FOO.txt.i at 0: missing revlog!
> +   warning: revlog 'data/FOO.txt.i' not in fncache!
>     0: empty or missing FOO.txt
>     FOO.txt at 0: f62022d3d590 in manifests not found
> -   data/QUICK.txt.i at 0: missing revlog!
> +   warning: revlog 'data/QUICK.txt.i' not in fncache!
>     0: empty or missing QUICK.txt
>     QUICK.txt at 0: 88b857db8eba in manifests not found
> -   data/bar.txt.i at 0: missing revlog!
> +   warning: revlog 'data/bar.txt.i' not in fncache!
>     0: empty or missing bar.txt
>     bar.txt at 0: 256559129457 in manifests not found
>    3 files, 1 changesets, 0 total revisions
> -  9 integrity errors encountered!
> +  3 warnings encountered!
> +  6 integrity errors encountered!
>    (first damaged changeset appears to be 0)
>    [1]

I agree that "missing revlog" for the case where the fncache file lacks
entries, is less than ideal.

Demoting such a case to a warning is probably justified.

Remark: I think that if the fncache file in a repo A lacks entries,
using A as the source in a 'hg clone --uncompressed' (for example) will
then produce a repo B which indeed has missing revlogs. 'hg verify' on B
will then fail.



More information about the Mercurial-devel mailing list