stablerange: use rangelength in subrangesclosure
We stop using the building '__len__' this get use closer to be able to use a
tuple.
--- a/hgext3rd/evolve/stablerange.py Wed Mar 22 18:37:11 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 18:39:47 2017 +0100
@@ -145,7 +145,8 @@
toproceed.append(r)
ranges = list(ranges)
n = repo.changelog.node
- ranges.sort(key=lambda r: (-len(r), n(r[0])))
+ rangelength = repo.stablerange.rangelength
+ ranges.sort(key=lambda r: (-rangelength(repo, r), n(r[0])))
return ranges
class stablerangecache(dict):