stablerange: fix merge slicing when range has multiple roots
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 24 Mar 2017 11:04:38 +0100
changeset 2222 6b19998242ed
parent 2221 f61d091d318e
child 2223 2ba541e1ea01
stablerange: fix merge slicing when range has multiple roots The first element in the bottom set is not necessarly the one with the lowest revision. We now properly compute and use the minimum value.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Fri Mar 24 09:04:34 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Fri Mar 24 11:04:38 2017 +0100
@@ -473,6 +473,7 @@
             bheads = set(bottomrevs)
             du = bheads.difference_update
             reachableroots = repo.changelog.reachableroots
+            minrev = min(bottomrevs)
             for r in bottomrevs:
                 du(parents(r, parentrevs))
             for h in bheads:
@@ -482,7 +483,7 @@
                 # "h" multiple time in a warming run. So using "ancestors" and
                 # caching that should be faster. But python code filtering on
                 # the ancestors end up being slower.
-                hrevs = reachableroots(bottomrevs[0], [h], bottomrevs, True)
+                hrevs = reachableroots(minrev, [h], bottomrevs, True)
                 start = self.depthrev(repo, h) - len(hrevs)
                 entry = (h, start)
                 result.append(entry)