stablesort: rename function to stablesort_branchpoint
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 25 Nov 2017 02:58:47 -0500
changeset 3245 63d58f7db120
parent 3244 d5a7edd5d008
child 3246 543708c3f754
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.
hgext3rd/evolve/stablerange.py
hgext3rd/evolve/stablesort.py
--- 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