stablerange: make use of the limit argument in 'mergepoint'
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 10 Dec 2017 01:38:48 +0100
changeset 3261 85160bd3f641
parent 3260 2f0c113b35f8
child 3262 774f69d74ec2
stablerange: make use of the limit argument in 'mergepoint' This will eventually avoid doing full iteration on ancestors of the head when retrieving the range content.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Sun Dec 10 01:33:39 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Sun Dec 10 01:38:48 2017 +0100
@@ -309,7 +309,16 @@
 class stablerange_mergepoint(stablerangecached, stablerangedummy_mergepoint):
     """Stablerange implementation using 'mergepoint' based sorting
     """
-    pass
+
+    def revsfromrange(self, repo, rangeid):
+        """return revision contained in a range
+
+        The range `(<head>, <skip>)` contains all revisions stable-sorted from
+        <head>, skipping the <index>th lower revisions.
+        """
+        limit = self.rangelength(repo, rangeid)
+        return stablesort.stablesort_mergepoint_head_basic(repo, [rangeid[0]],
+                                                           limit=limit)
 
 class stablerange(stablerangecached):