# HG changeset patch # User Pierre-Yves David # Date 1490211379 -3600 # Node ID c583efbaec78ac43160d7e39eeb866582e155619 # Parent 57d58f27ffaeb291d6f52e84cf8b121104ea3b1b revsfromrange: update cache for parentrange directly in the code We update it where it matters if we detect that we have the data. diff -r 57d58f27ffae -r c583efbaec78 hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py Wed Mar 22 20:34:07 2017 +0100 +++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 20:36:19 2017 +0100 @@ -318,7 +318,12 @@ rangedepth = self.depthrev(repo, rangeid[0]) topsize = rangedepth - globalindex - parentrange = stablerange(repo, p1, rangeid[1], rangeid._revs[:-1]) + parentrange = stablerange(repo, p1, rangeid[1]) + # if we have an entry for the current range, lets update the cache + if rangeid in self._revsinrangecache: + parentrevs = self._revsinrangecache[rangeid][:-1] + self._revsinrangecache[parentrange] = parentrevs + if topsize == 1: top = stablerange(repo, rangeid[0], globalindex, [rangeid[0]]) return [parentrange, top]