revsfromcache: update cache for the top slice if possible
Same logic, we update the cache if have the data.
--- a/hgext3rd/evolve/stablerange.py Wed Mar 22 20:37:03 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 20:37:27 2017 +0100
@@ -336,7 +336,11 @@
# wait for that heavy object to be gone.
parentsubranges = self.subranges(repo, parentrange)
slices = parentsubranges[:-1] # pop the top
- top = stablerange(repo, rangeid[0], globalindex, rangeid._revs[-topsize:])
+ top = stablerange(repo, rangeid[0], globalindex)
+ # if we have an entry for the current range, lets update the cache
+ if rangeid in self._revsinrangecache:
+ parentrevs = self._revsinrangecache[rangeid][-topsize:]
+ self._revsinrangecache[top] = parentrevs
slices.append(top)
return slices