changeset 2187:c583efbaec78

revsfromrange: update cache for parentrange directly in the code We update it where it matters if we detect that we have the data.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 22 Mar 2017 20:36:19 +0100
parents 57d58f27ffae
children b8a8b7ee26b7
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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]