[PATCH v2-with-qref] verify: look for missing revlogs
Mads Kiilerich
mads at kiilerich.com
Sat Apr 21 18:57:32 UTC 2012
Adrian Buehlmann wrote, On 04/21/2012 08:10 PM:
> On 2012-04-21 19:21, Mads Kiilerich wrote:
>> 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.
You are right. fncache should be private.
(It seems like fncachestore is the only store where a revlog can be
opened even though it is missing from storefiles so I guess it is safe
... but that doesn't make it right.)
Until a too-last-minute change I used
+ # open revlog for write to add it to fncache
+ repo.store.opener(ff, 'ab').close()
That might be the least intrusive way to do it anyway.
/Mads
More information about the Mercurial-devel
mailing list