bisect: no need to save the state if it wasn't changed
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 01 Nov 2009 03:26:10 +0100
changeset 9689 57cee011ffcb
parent 9688 dd5a16ad420e
child 9690 b33d70849a20
bisect: no need to save the state if it wasn't changed
mercurial/commands.py
--- a/mercurial/commands.py	Sun Nov 01 02:57:11 2009 +0100
+++ b/mercurial/commands.py	Sun Nov 01 03:26:10 2009 +0100
@@ -370,14 +370,14 @@
 
     # update state
     node = repo.lookup(rev or '.')
-    if good:
-        state['good'].append(node)
-    elif bad:
-        state['bad'].append(node)
-    elif skip:
-        state['skip'].append(node)
-
-    hbisect.save_state(repo, state)
+    if good or bad or skip:
+        if good:
+            state['good'].append(node)
+        elif bad:
+            state['bad'].append(node)
+        elif skip:
+            state['skip'].append(node)
+        hbisect.save_state(repo, state)
 
     if not check_state(state):
         return