changeset 7557:21233de9c053

Circumvent removal of valid bisect candidates due to previously skipped ones As reported in issue 1445: A valid candidate revision for a bisect test is not considered for testing due to its skipped ancestor. If this revision is the only untested one left an assertion error occurs.
author Bernhard Leiner <bleiner@gmail.com>
date Sat, 27 Dec 2008 19:05:26 +0100
parents a9221c7f51a4
children dc211ad8d681
files mercurial/hbisect.py tests/test-bisect tests/test-bisect.out
diffstat 3 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hbisect.py	Wed Dec 31 15:04:18 2008 +0100
+++ b/mercurial/hbisect.py	Sat Dec 27 19:05:26 2008 +0100
@@ -102,7 +102,7 @@
             if value == perfect: # found a perfect candidate? quit early
                 break
 
-        if y < perfect: # all downhill from here?
+        if y < perfect and rev not in skip: # all downhill from here?
             for c in children.get(rev, []):
                 poison[c] = True # poison children
             continue
--- a/tests/test-bisect	Wed Dec 31 15:04:18 2008 +0100
+++ b/tests/test-bisect	Sat Dec 27 19:05:26 2008 +0100
@@ -72,3 +72,13 @@
 echo % test no action
 hg bisect -r
 hg bisect || echo failure
+
+echo % reproduce AssertionError, issue1445
+hg bisect -r
+hg bisect -b 6
+hg bisect -g 0
+hg bisect -s
+hg bisect -s
+hg bisect -s
+hg bisect -s 
+hg bisect -g
--- a/tests/test-bisect.out	Wed Dec 31 15:04:18 2008 +0100
+++ b/tests/test-bisect.out	Sat Dec 27 19:05:26 2008 +0100
@@ -286,3 +286,20 @@
 % test no action
 abort: cannot bisect (no known good revisions)
 failure
+% reproduce AssertionError, issue1445
+Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+The first bad revision is:
+changeset:   6:a3d5c6fdf0d3
+user:        test
+date:        Thu Jan 01 00:00:06 1970 +0000
+summary:     msg 6
+