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.
--- 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)