[PATCH 2 of 2 V4] repoview: discard filtered changelog if index isn't shared with unfiltered

Yuya Nishihara yuya at tcha.org
Sun Feb 14 10:00:12 EST 2016


On Sun, 14 Feb 2016 01:39:03 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1455381235 -32400
> #      Sun Feb 14 01:33:55 2016 +0900
> # Node ID 8ffe33c0a67bdd0a1fdf6c5c6e3c17946717c122
> # Parent  4f589e36e0a5879f243cf958ea2e03f24c204670
> repoview: discard filtered changelog if index isn't shared with unfiltered

Looks good to me and confirmed the test does crash without this change.
I want a review by Pierre-Yves. Can you take a look?

> --- a/mercurial/repoview.py
> +++ b/mercurial/repoview.py
> @@ -315,7 +315,8 @@ class repoview(object):
>          revs = filterrevs(unfi, self.filtername)
>          cl = self._clcache
>          newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed)
> -        if cl is not None and newkey != self._clcachekey:
> +        if (cl is not None and
> +            (cl.index is not unfiindex or newkey != self._clcachekey)):

This is tricky. I want to add a comment that says

  # if cl.index is not unfiindex, unfi.changelog cache would be
  # recreated and our clcache refers to garbage object

Does it make sense?


More information about the Mercurial-devel mailing list