# HG changeset patch # User Pierre-Yves David # Date 1512866019 -3600 # Node ID 2f0c113b35f8b38acb94eb5a4d33e39accc15152 # Parent b63d03db0ab90eea48fe0c7a2cdde95563f0abd2 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. diff -r b63d03db0ab9 -r 2f0c113b35f8 hgext3rd/evolve/stablerange.py --- 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): diff -r b63d03db0ab9 -r 2f0c113b35f8 tests/test-stablerange.t --- 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