changeset 2189:40b0e1dbed90

revsfromcache: update cache for the top slice if possible Same logic, we update the cache if have the data.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 22 Mar 2017 20:37:27 +0100
parents b8a8b7ee26b7
children f4cc3cf27a3a
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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