stablesort: rename function to stablesort_branchpoint
We are about to test different approach to stable sorting. We clarify that the
existing method is sorting from branch points.
--- a/hgext3rd/evolve/stablerange.py Sat Dec 09 17:14:53 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py Sat Nov 25 02:58:47 2017 -0500
@@ -267,8 +267,8 @@
allrevs = self._getrevsfrommerge(repo, headrev)
if allrevs is None:
mc = self._filestablesortcache
- allrevs = stablesort.stablesort(repo, [headrev],
- mergecallback=mc)
+ sorting = stablesort.stablesort_branchpoint
+ allrevs = sorting(repo, [headrev], mergecallback=mc)
self._stablesortcache[headrev] = allrevs
# takes from index
revs = allrevs[index:]
--- a/hgext3rd/evolve/stablesort.py Sat Dec 09 17:14:53 2017 +0100
+++ b/hgext3rd/evolve/stablesort.py Sat Nov 25 02:58:47 2017 -0500
@@ -37,13 +37,13 @@
"""
revs = scmutil.revrange(repo, opts['rev'])
displayer = cmdutil.show_changeset(ui, repo, opts, buffered=True)
- for r in stablesort(repo, revs):
+ for r in stablesort_branchpoint(repo, revs):
ctx = repo[r]
displayer.show(ctx)
displayer.flush(ctx)
displayer.close()
-def stablesort(repo, revs, mergecallback=None):
+def stablesort_branchpoint(repo, revs, mergecallback=None):
"""return '::revs' topologically sorted in "stable" order
This is a depth first traversal starting from 'nullrev', using node as a