stablerange: use rangelength in debugstablerange
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 18:36:37 +0100
changeset 2165 e97e9b0c9711
parent 2164 cc8ae2a66b0f
child 2166 d4ff8708eb66
stablerange: use rangelength in debugstablerange We stop using the building '__len__' this get use closer to be able to use a tuple.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 18:35:05 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 18:36:37 2017 +0100
@@ -398,13 +398,14 @@
     # prewarm depth cache
     repo.stablerange.warmup(repo, revs)
     cl = repo.changelog
+    rangelength = repo.stablerange.rangelength
     ranges = stablerange.subrangesclosure(repo, revs)
     ui.status('rev         node index size depth      obshash\n')
     for r in ranges:
         d = (r[0],
              s(cl.node(r[0])),
              r[1],
-             len(r),
+             rangelength(repo, r),
              r.depth,
              node.short(_obshashrange(repo, r)))
         ui.status('%3d %s %5d %4d %5d %s\n' % d)