bisect: simplify conditional in 'check_state'
Now that extra code about "updating" flag have been removed, we can simplify the
condition flow and remove a level.
--- a/mercurial/commands.py Wed Aug 24 04:22:40 2016 +0200
+++ b/mercurial/commands.py Wed Aug 24 04:23:13 2016 +0200
@@ -836,12 +836,12 @@
Returns 0 on success.
"""
def checkstate(state):
- if not state['good'] or not state['bad']:
- if not state['good']:
- raise error.Abort(_('cannot bisect (no known good revisions)'))
- else:
- raise error.Abort(_('cannot bisect (no known bad revisions)'))
- return True
+ if state['good'] and state['bad']:
+ return True
+ if not state['good']:
+ raise error.Abort(_('cannot bisect (no known good revisions)'))
+ else:
+ raise error.Abort(_('cannot bisect (no known bad revisions)'))
# backward compatibility
if rev in "good bad reset init".split():