stablesort: expose the jumps sequence to other code
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 10 Dec 2017 02:46:05 +0100
changeset 3323 4a84947010a1
parent 3322 20b6dae466a7
child 3324 6ba8eaffe8f6
stablesort: expose the jumps sequence to other code The stable range needs it to build exclusive subrange efficiently.
hgext3rd/evolve/stablesort.py
--- a/hgext3rd/evolve/stablesort.py	Wed Dec 20 16:20:26 2017 +0100
+++ b/hgext3rd/evolve/stablesort.py	Sun Dec 10 02:46:05 2017 +0100
@@ -329,6 +329,12 @@
         result.reverse()
         return result
 
+    def getjumps(self, repo, rev):
+        if self._jumps[rev] is None:
+            # still won't load anything if rev is not a merge
+            self.get(repo, rev) # we can be smarter here
+        return self._jumps[rev]
+
     def walkfrom(self, repo, head):
         tiebreaker = _mergepoint_tie_breaker(repo)
         cl = repo.changelog