revsfromrange: update cache for parentrange directly in the code
We update it where it matters if we detect that we have the data.
--- 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]