diff mercurial/obsutil.py @ 43661:32048206e7be

merge with stable
author Yuya Nishihara <yuya@tcha.org>
date Fri, 15 Nov 2019 22:22:55 +0900
parents acaff50079ff e513e87b0476
children 9d2b2df2c2ba
line wrap: on
line diff
--- a/mercurial/obsutil.py	Thu Nov 14 20:40:54 2019 -0800
+++ b/mercurial/obsutil.py	Fri Nov 15 22:22:55 2019 +0900
@@ -112,6 +112,11 @@
         yield marker(repo, markerdata)
 
 
+def sortedmarkers(markers):
+    # last item of marker tuple ('parents') may be None or a tuple
+    return sorted(markers, key=lambda m: m[:-1] + (m[-1] or (),))
+
+
 def closestpredecessors(repo, nodeid):
     """yield the list of next predecessors pointing on visible changectx nodes
 
@@ -675,7 +680,7 @@
             #   Having none means pruned node, multiple successors means split,
             #   single successors are standard replacement.
             #
-            for mark in sorted(succmarkers[current]):
+            for mark in sortedmarkers(succmarkers[current]):
                 for suc in mark[1]:
                     if suc not in cache:
                         if suc in stackedset:
@@ -712,7 +717,7 @@
                 # duplicated entry and successors set that are strict subset of
                 # another one.
                 succssets = []
-                for mark in sorted(succmarkers[current]):
+                for mark in sortedmarkers(succmarkers[current]):
                     # successors sets contributed by this marker
                     base = _succs()
                     base.markers.add(mark)