changeset 30125:3528117c7b4e

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 24 Aug 2016 04:23:13 +0200
parents 0aea706060cc
children 755730fc1e48
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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():