[PATCH] localrepo: actually invalidate dirstate on invalidatedirstate()

Durham Goode durham at fb.com
Fri Aug 26 11:56:00 EDT 2016


cc foozy, is this another case of the file caches not handling 
timestamps correctly?


On 8/26/16 8:31 AM, Mateusz Kwapich wrote:
> # HG changeset patch
> # User Mateusz Kwapich <mitrandir at fb.com>
> # Date 1472225341 25200
> #      Fri Aug 26 08:29:01 2016 -0700
> # Node ID 430e8c2cc229e0fbed231370c36cc2a215ecb30e
> # Parent  318e2b600b80e4ed3c6f37df46ec7544f60d4c0b
> localrepo: actually invalidate dirstate on invalidatedirstate()
>
> The old dirstate was still present in the filecache. It was invalidated only
> because filecache did stat the file on the next access. This can lead to errors
> in the case when file stat didn't change but the dirstate contents did change
> (and we know about it and thats why we sometimes call dirstateinvalidate() to
> refresh it).
>
> After this patch we will also invalidate the filecache on dirstateinvalidate.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -1243,6 +1243,7 @@ class localrepository(object):
>                       delattr(self.dirstate, k)
>                   except AttributeError:
>                       pass
> +            self._filecache.pop('dirstate', None)
>               delattr(self.unfiltered(), 'dirstate')
>   
>       def invalidate(self, clearfilecache=False):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DQIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=Ro2r-ldcUCad0uCIJEkuIsww7ygVLn2SIOUiLYU_6zY&s=d2RkRfdC6CgrbggcTpSpUpXARuyLfhqkT4MHmdMAxFc&e=



More information about the Mercurial-devel mailing list