# HG changeset patch # User Alexander Krauss # Date 2011-07-16 22:36:43 # Node ID a35d6f822e3e6312c370b7261bf535e9853a8317 # Parent 3db92e3948d5f23a842c9f1e9940233c9bf5e699 hbisect: do not assume that min(good) is an ancestor of min(bad) The included test used to report "inconsistent state", which is incorrect. While this situation cannot occur when the user sticks to the suggested bisect sequence. However, adding more consistent good/bad information to the bisect state should be tolerated as well. diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py --- a/mercurial/hbisect.py +++ b/mercurial/hbisect.py @@ -35,8 +35,9 @@ def bisect(changelog, state): # build visit array ancestors = [None] * (len(changelog) + 1) # an extra for [-1] - # set nodes descended from goodrev - ancestors[goodrev] = [] + # set nodes descended from goodrevs + for rev in goodrevs: + ancestors[rev] = [] for rev in xrange(goodrev + 1, len(changelog)): for prev in clparents(rev): if ancestors[prev] == []: diff --git a/tests/test-bisect2.t b/tests/test-bisect2.t --- a/tests/test-bisect2.t +++ b/tests/test-bisect2.t @@ -431,3 +431,22 @@ end at merge: 17 bad, 11 good (but 9 is date: Thu Jan 01 00:00:09 1970 +0000 summary: 9 + +user adds irrelevant but consistent information (here: -g 2) to bisect state + + $ hg bisect -r + $ hg bisect -b 13 + $ hg bisect -g 8 + Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg bisect -g 2 + Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg bisect -b + The first bad revision is: + changeset: 11:82ca6f06eccd + parent: 8:dab8161ac8fc + user: test + date: Thu Jan 01 00:00:11 1970 +0000 + summary: 11 +