stablerange: use repo-carried stablesortcache
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 00:06:07 +0100
changeset 3339 f0933cdf614d
parent 3338 3f049353d733
child 3340 fd90e73bf79a
stablerange: use repo-carried stablesortcache That one is common to all and disk persisted
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Thu Dec 21 00:34:31 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Thu Dec 21 00:06:07 2017 +0100
@@ -340,7 +340,6 @@
     """
 
     def __init__(self):
-        self._sortcache = stablesort.stablesortcache()
         super(stablerange_mergepoint, self).__init__()
 
     def warmup(self, repo, upto=None):
@@ -354,7 +353,7 @@
         <head>, skipping the <index>th lower revisions.
         """
         limit = self.rangelength(repo, rangeid)
-        return self._sortcache.get(repo, rangeid[0], limit=limit)
+        return repo.stablesort.get(repo, rangeid[0], limit=limit)
 
     def _stableparent(self, repo, headrev):
         """The parent of the changeset with reusable subrange
@@ -450,8 +449,8 @@
         result = []
         depth = repo.depthcache.get
         nextmerge = repo.firstmergecache.get
-        walkfrom = functools.partial(self._sortcache.walkfrom, repo)
-        getjumps = functools.partial(self._sortcache.getjumps, repo)
+        walkfrom = functools.partial(repo.stablesort.walkfrom, repo)
+        getjumps = functools.partial(repo.stablesort.getjumps, repo)
         skips = depth(headrev) - slicepoint
         tomap = slicepoint - initial_index