[PATCH] dirstate: add docstring for invalidate

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jun 4 19:24:35 EDT 2017


On 06/05/2017 12:09 AM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1496617730 25200
> #      Sun Jun 04 16:08:50 2017 -0700
> # Node ID 45841cedb603b93803eec37bd7d01456a6b8e812
> # Parent  5277d6faabb4f9593a5d33cdab6c4a6191ad856d
> dirstate: add docstring for invalidate
>
> This always confuses me, and we already have a docstring on
> localrepo.invalidatedirstate.

That look good to me.

>
> diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
> --- a/mercurial/dirstate.py
> +++ b/mercurial/dirstate.py
> @@ -470,6 +470,12 @@ class dirstate(object):
>              self._pl = p
>
>      def invalidate(self):
> +        '''Causes the next access to reread the dirstate.
> +
> +        This is different from localrepo.invalidatedirstate() because it always
> +        rereads the dirstate. Use localrepo.invalidatedirstate() if you want to
> +        check whether the dirstate has changed before rereading it.'''
> +
>          for a in ("_map", "_copymap", "_filefoldmap", "_dirfoldmap", "_branch",
>                    "_pl", "_dirs", "_ignore", "_nonnormalset",
>                    "_otherparentset"):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list