[PATCH STABLE] localrepo: recreate phasecache if changelog was modified (issue4855)

Sean Farley sean at farley.io
Tue Sep 29 12:28:41 CDT 2015


Yuya Nishihara <yuya at tcha.org> writes:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1443531428 -32400
> #      Tue Sep 29 21:57:08 2015 +0900
> # Branch stable
> # Node ID 328782664248045a87f3f99a22cbb5b8834ec9d1
> # Parent  f31ddc9bfa5f8f28cd899e907a0a9edb072b3e9a
> localrepo: recreate phasecache if changelog was modified (issue4855)
>
> Because _phaserevs and _phasesets cache revision numbers, they must be
> invalidated if there are new commits or stripped revisions. We could do
> that by calling _phasecache.invalidate(), but it wasn't simple to be
> integrated with the filecache mechanism.
>
> So for now, phasecache will be recreated after repo.invalidate() if
> 00changelog.i was modified before.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -429,7 +429,10 @@ class localrepository(object):
>                  heads.append(n)
>          return heads
>  
> -    @storecache('phaseroots')
> +    # _phaserevs and _phasesets depend on changelog. what wee need is to

Small typo: wee -> we (hopefully the reviewer can fix in flight). Looks
good otherwise.


More information about the Mercurial-devel mailing list