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.
--- 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