##// END OF EJS Templates
py3: fix sorting of obsolete markers in obsutil (issue6217)...
Denis Laxalde -
r43858:e513e87b stable
parent child Browse files
Show More
@@ -28,6 +28,7 b' from . import ('
28 28 logexchange,
29 29 narrowspec,
30 30 obsolete,
31 obsutil,
31 32 phases,
32 33 pushkey,
33 34 pycompat,
@@ -99,11 +100,6 b' class bundlespec(object):'
99 100 contentopts = attr.ib()
100 101
101 102
102 def _sortedmarkers(markers):
103 # last item of marker tuple ('parents') may be None or a tuple
104 return sorted(markers, key=lambda m: m[:-1] + (m[-1] or (),))
105
106
107 103 def parsebundlespec(repo, spec, strict=True):
108 104 """Parse a bundle string specification into parts.
109 105
@@ -1140,7 +1136,7 b' def _pushb2obsmarkers(pushop, bundler):'
1140 1136 return
1141 1137 pushop.stepsdone.add(b'obsmarkers')
1142 1138 if pushop.outobsmarkers:
1143 markers = _sortedmarkers(pushop.outobsmarkers)
1139 markers = obsutil.sortedmarkers(pushop.outobsmarkers)
1144 1140 bundle2.buildobsmarkerspart(bundler, markers)
1145 1141
1146 1142
@@ -1475,7 +1471,7 b' def _pushobsolete(pushop):'
1475 1471 if pushop.outobsmarkers:
1476 1472 pushop.ui.debug(b'try to push obsolete markers to remote\n')
1477 1473 rslts = []
1478 markers = _sortedmarkers(pushop.outobsmarkers)
1474 markers = obsutil.sortedmarkers(pushop.outobsmarkers)
1479 1475 remotedata = obsolete._pushkeyescape(markers)
1480 1476 for key in sorted(remotedata, reverse=True):
1481 1477 # reverse sort to ensure we end with dump0
@@ -2573,7 +2569,7 b' def _getbundleobsmarkerpart('
2573 2569 heads = repo.heads()
2574 2570 subset = [c.node() for c in repo.set(b'::%ln', heads)]
2575 2571 markers = repo.obsstore.relevantmarkers(subset)
2576 markers = _sortedmarkers(markers)
2572 markers = obsutil.sortedmarkers(markers)
2577 2573 bundle2.buildobsmarkerspart(bundler, markers)
2578 2574
2579 2575
@@ -112,6 +112,11 b' def getmarkers(repo, nodes=None, exclusi'
112 112 yield marker(repo, markerdata)
113 113
114 114
115 def sortedmarkers(markers):
116 # last item of marker tuple ('parents') may be None or a tuple
117 return sorted(markers, key=lambda m: m[:-1] + (m[-1] or (),))
118
119
115 120 def closestpredecessors(repo, nodeid):
116 121 """yield the list of next predecessors pointing on visible changectx nodes
117 122
@@ -675,7 +680,7 b' def successorssets(repo, initialnode, cl'
675 680 # Having none means pruned node, multiple successors means split,
676 681 # single successors are standard replacement.
677 682 #
678 for mark in sorted(succmarkers[current]):
683 for mark in sortedmarkers(succmarkers[current]):
679 684 for suc in mark[1]:
680 685 if suc not in cache:
681 686 if suc in stackedset:
@@ -712,7 +717,7 b' def successorssets(repo, initialnode, cl'
712 717 # duplicated entry and successors set that are strict subset of
713 718 # another one.
714 719 succssets = []
715 for mark in sorted(succmarkers[current]):
720 for mark in sortedmarkers(succmarkers[current]):
716 721 # successors sets contributed by this marker
717 722 base = _succs()
718 723 base.markers.add(mark)
General Comments 0
You need to be logged in to leave comments. Login now