findmissingrange: properly queue new subrange for slicing
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 23 Mar 2017 10:07:21 +0100
changeset 2203 8a2e1f6e5443
parent 2202 5f8a2604bb2b
child 2204 61a8b51348a1
findmissingrange: properly queue new subrange for slicing The previous code was buggy and used the wrong variable leading to no extra slicing being performed to file the sample at the requested size.
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Thu Mar 23 10:06:20 2017 +0100
+++ b/hgext3rd/evolve/obsdiscovery.py	Thu Mar 23 10:07:21 2017 +0100
@@ -289,9 +289,9 @@
                 _key, target = heappop(sliceme)
                 for new in subranges(local, target):
                     # XXX we could record hierarchy to optimise drop
-                    if addentry(entry):
-                        if 1 < len(entry):
-                            heappush(sliceme, (-rangelength(local, entry), entry))
+                    if addentry(new):
+                        if 1 < len(new):
+                            heappush(sliceme, (-rangelength(local, new), new))
                         needed -= 1
                         if needed <= 0:
                             break