changeset 30122:b710dca9937a

bisect: minor movement of code handle flag updating state The code flag handling is quite complicated, we are moving code around to prepare further simplification.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 24 Aug 2016 04:48:17 +0200
parents bbbf6bbbd05f
children 2e360578688d
files mercurial/commands.py
diffstat 1 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Oct 09 04:37:02 2016 -0400
+++ b/mercurial/commands.py	Wed Aug 24 04:48:17 2016 +0200
@@ -866,6 +866,20 @@
 
     state = hbisect.load_state(repo)
 
+    # update state
+    if good or bad or skip:
+        if rev:
+            nodes = [repo.lookup(i) for i in scmutil.revrange(repo, [rev])]
+        else:
+            nodes = [repo.lookup('.')]
+        if good:
+            state['good'] += nodes
+        elif bad:
+            state['bad'] += nodes
+        elif skip:
+            state['skip'] += nodes
+        hbisect.save_state(repo, state)
+
     if command:
         changesets = 1
         if noupdate:
@@ -914,22 +928,6 @@
         hbisect.printresult(ui, repo, state, displayer, nodes, bgood)
         return
 
-    # update state
-
-    if rev:
-        nodes = [repo.lookup(i) for i in scmutil.revrange(repo, [rev])]
-    else:
-        nodes = [repo.lookup('.')]
-
-    if good or bad or skip:
-        if good:
-            state['good'] += nodes
-        elif bad:
-            state['bad'] += nodes
-        elif skip:
-            state['skip'] += nodes
-        hbisect.save_state(repo, state)
-
     if not check_state(state):
         return