[PATCH 1 of 3] hbisect: confine loop to the relevant interval

Alexander Krauss krauss at in.tum.de
Sat Jul 16 17:40:40 CDT 2011


# HG changeset patch
# User Alexander Krauss <krauss at in.tum.de>
# Date 1310811760 -7200
# Node ID ed7dba2c073f790d49079f79a09fc7358a340d29
# Parent  946f4381c1cb768939f4edd9c7764c3a157843ee
hbisect: confine loop to the relevant interval

In this context we know that ancestors[rev] == None for all rev <= goodrev,
so looping further back is unnecessary (and confusing).

diff -r 946f4381c1cb -r ed7dba2c073f mercurial/hbisect.py
--- a/mercurial/hbisect.py	Fri Jul 15 18:03:37 2011 -0500
+++ b/mercurial/hbisect.py	Sat Jul 16 12:22:40 2011 +0200
@@ -45,7 +45,7 @@
         # clear good revs from array
         for node in goodrevs:
             ancestors[node] = None
-        for rev in xrange(len(changelog), -1, -1):
+        for rev in xrange(len(changelog), goodrev, -1):
             if ancestors[rev] is None:
                 for prev in clparents(rev):
                     ancestors[prev] = None


More information about the Mercurial-devel mailing list