changeset 30124:0aea706060cc

bisect: remove code about "update-flag" in check_state Now that the flag dedicated to updating the flag are handled earlier, we do not need to handle them in the 'check_state' function.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 24 Aug 2016 04:22:40 +0200
parents 2e360578688d
children 3528117c7b4e
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Oct 09 03:50:55 2016 +0200
+++ b/mercurial/commands.py	Wed Aug 24 04:22:40 2016 +0200
@@ -835,10 +835,8 @@
 
     Returns 0 on success.
     """
-    def checkstate(state, interactive=True):
+    def checkstate(state):
         if not state['good'] or not state['bad']:
-            if (good or bad or skip or reset) and interactive:
-                return
             if not state['good']:
                 raise error.Abort(_('cannot bisect (no known good revisions)'))
             else:
@@ -879,6 +877,8 @@
         elif skip:
             state['skip'] += nodes
         hbisect.save_state(repo, state)
+        if not (state['good'] and state['bad']):
+            return
 
     if command:
         changesets = 1
@@ -913,7 +913,7 @@
                 rev = None # clear for future iterations
                 state[transition].append(ctx.node())
                 ui.status(_('changeset %d:%s: %s\n') % (ctx, ctx, transition))
-                checkstate(state, interactive=False)
+                checkstate(state)
                 # bisect
                 nodes, changesets, bgood = hbisect.bisect(repo.changelog, state)
                 # update to next check
@@ -928,8 +928,7 @@
         hbisect.printresult(ui, repo, state, displayer, nodes, bgood)
         return
 
-    if not checkstate(state):
-        return
+    checkstate(state)
 
     # actually bisect
     nodes, changesets, good = hbisect.bisect(repo.changelog, state)