stablerange: introduce a smarte version of stablerange for 'mergepoint'
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 10 Dec 2017 01:33:39 +0100
changeset 3260 2f0c113b35f8
parent 3259 b63d03db0ab9
child 3261 85160bd3f641
stablerange: introduce a smarte version of stablerange for 'mergepoint' This implementation will using caching and smarter algorithm based on these cache. For now it inherit most of it code from the dummy version for convenience. The inheritance to the dummy version should be dropped eventually.
hgext3rd/evolve/stablerange.py
tests/test-stablerange.t
--- a/hgext3rd/evolve/stablerange.py	Sun Dec 10 01:26:40 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Sun Dec 10 01:33:39 2017 +0100
@@ -77,6 +77,7 @@
     'branchpoint': lambda repo: repo.stablerange,
     'basic-branchpoint': lambda repo: stablerangebasic(),
     'basic-mergepoint': lambda repo: stablerangedummy_mergepoint(),
+    'mergepoint': lambda repo: stablerange_mergepoint(),
 }
 
 @eh.command(
@@ -305,6 +306,11 @@
         headrev, index = rangeid[0], rangeid[1]
         return self.depthrev(repo, headrev) - index
 
+class stablerange_mergepoint(stablerangecached, stablerangedummy_mergepoint):
+    """Stablerange implementation using 'mergepoint' based sorting
+    """
+    pass
+
 class stablerange(stablerangecached):
 
     def __init__(self, lrusize=2000):
--- a/tests/test-stablerange.t	Sun Dec 10 01:26:40 2017 +0100
+++ b/tests/test-stablerange.t	Sun Dec 10 01:33:39 2017 +0100
@@ -9,7 +9,7 @@
   > [ui]
   > logtemplate = "{rev} {node|short} {desc} {tags}\n"
   > [defaults]
-  > debugstablerange = --method basic-mergepoint
+  > debugstablerange = --method mergepoint
   > EOF
 
 Simple linear test