diff mercurial/hbisect.py @ 5777:51776e50bc8c

bisect: improve tests - test skipping - test noupdate - test bad->good search - test inconsistent state
author Matt Mackall <mpm@selenic.com>
date Mon, 31 Dec 2007 18:20:34 -0600
parents 35ec669cdd43
children fe8dbbe9520d
line wrap: on
line diff
--- a/mercurial/hbisect.py	Mon Dec 31 18:20:34 2007 -0600
+++ b/mercurial/hbisect.py	Mon Dec 31 18:20:34 2007 -0600
@@ -30,7 +30,7 @@
                     ancestors[prev] = None
 
         if ancestors[badrev] is None:
-            return None, None
+            return badrev, None
         return badrev, ancestors
 
     good = 0
@@ -38,10 +38,10 @@
     if not ancestors: # looking for bad to good transition?
         good = 1
         badrev, ancestors = buildancestors(state['good'], state['bad'])
+    bad = changelog.node(badrev)
     if not ancestors: # now we're confused
         raise util.Abort(_("Inconsistent state, %s:%s is good and bad")
                          % (badrev, hg.short(bad)))
-    bad = changelog.node(badrev)
 
     # build children dict
     children = {}