stablerange: use subranges from the main class in findrangemissing
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 19:20:30 +0100
changeset 2174 71c518470e2c
parent 2173 53352bf5b7fc
child 2175 4162dbe7ff5c
stablerange: use subranges from the main class in findrangemissing This is the last method used on the class.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 18:55:26 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Wed Mar 22 19:20:30 2017 +0100
@@ -242,6 +242,7 @@
     heads = local.revs('heads(%ld)', probeset)
 
     rangelength = local.stablerange.rangelength
+    subranges = local.stablerange.subranges
     # size of slice ?
     heappop = heapq.heappop
     heappush = heapq.heappush
@@ -286,7 +287,7 @@
 
             while sliceme and 0 < needed:
                 _key, target = heappop(sliceme)
-                for new in target.subranges():
+                for new in subranges(local, target):
                     # XXX we could record hierarchy to optimise drop
                     if addentry(entry):
                         if 1 < len(entry):
@@ -313,7 +314,7 @@
             elif 1 == rangelength(local, entry):
                 missing.add(n(entry[0]))
             else:
-                for new in entry.subranges():
+                for new in subranges(local, entry):
                     addentry(new)
         assert nbsample == nbreplies
         querycount += 1