[PATCH v2-with-qref] verify: look for missing revlogs

Adrian Buehlmann adrian at cadifra.com
Sat Apr 21 13:10:16 CDT 2012


On 2012-04-21 19:21, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads at kiilerich.com>
> # Date 1335028453 -7200
> # Branch stable
> # Node ID 2cd05013d0c9e664189c45a7d7396408b7be367e
> # Parent  e966c636e5412cb5e99ffcd7fa41cd8618ed6d7c
> verify: look for missing revlogs
> 
> Verify removed missing revlogs from fncache while checking and warning "missing
> revlog!". That made the revlogs even more missing and it made recovery harder.
> 
> Verify could be considered a read-only operation and it might thus not be
> appreciated that it modify the repo it is testing in any way. The fncache name
> do however imply that it is a cache and it could thus be considered ok that it
> updates the cache ... if only there were some means to populate the cache with
> missing entries. fncache is apparently more like a index or a map than a cache.
> 
> This change allow verify to recover the fncache entries it (or other commands)
> has removed.

Sounds a bit scary to accept for stable while in feature freeze...

> diff --git a/mercurial/verify.py b/mercurial/verify.py
> --- a/mercurial/verify.py
> +++ b/mercurial/verify.py
> @@ -229,7 +229,12 @@
>              try:
>                  storefiles.remove(ff)
>              except KeyError:
> -                err(lr, _("missing revlog!"), ff)
> +                try:
> +                    repo.store.opener(ff)
> +                    warn(" %s: found missing revlog" % ff)
> +                    repo.store.fncache.add(ff)

Here, you are (wrongfully) assuming that every store has an fncache
object, but this is only the case for fncachestore(s).

Neither encodedstore nor basicstore have an fncache object.

> +                except IOError, e:
> +                    err(lr, _("missing revlog!"), ff)
>  
>          checklog(fl, f, lr)
>          seen = {}


More information about the Mercurial-devel mailing list