[PATCH 1 of 2 stable] bisect: report "both good and bad" as such, not as "not directly related"

Mads Kiilerich mads at kiilerich.com
Sun Nov 10 11:58:40 CST 2013


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1384105881 -3600
#      Sun Nov 10 18:51:21 2013 +0100
# Branch stable
# Node ID a19429a57d1b9386eba4775929a4e82fd3070d74
# Parent  ba6486076429e5c20d910b8a5d4f8acf1e9dc1b1
bisect: report "both good and bad" as such, not as "not directly related"

diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py
--- a/mercurial/hbisect.py
+++ b/mercurial/hbisect.py
@@ -62,7 +62,8 @@ def bisect(changelog, state):
         badrev, ancestors = buildancestors(state['good'], state['bad'])
     bad = changelog.node(badrev)
     if not ancestors: # now we're confused
-        if len(state['bad']) == 1 and len(state['good']) == 1:
+        if (len(state['bad']) == 1 and len(state['good']) == 1 and
+            state['bad'] != state['good']):
             raise util.Abort(_("starting revisions are not directly related"))
         raise util.Abort(_("inconsistent state, %s:%s is good and bad")
                          % (badrev, short(bad)))
diff --git a/tests/test-bisect.t b/tests/test-bisect.t
--- a/tests/test-bisect.t
+++ b/tests/test-bisect.t
@@ -280,7 +280,7 @@ skip
   $ hg bisect -r
   $ hg bisect -g tip
   $ hg bisect -b tip
-  abort: starting revisions are not directly related
+  abort: inconsistent state, 31:58c80a7c8a40 is good and bad
   [255]
 
   $ hg bisect -r


More information about the Mercurial-devel mailing list