Mercurial > hg
changeset 5777:51776e50bc8c
bisect: improve tests
- test skipping
- test noupdate
- test bad->good search
- test inconsistent state
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 31 Dec 2007 18:20:34 -0600 |
parents | 35ec669cdd43 |
children | 9e97a7a0bb82 |
files | mercurial/hbisect.py tests/test-bisect tests/test-bisect.out |
diffstat | 3 files changed, 32 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hbisect.py Mon Dec 31 18:20:34 2007 -0600 +++ b/mercurial/hbisect.py Mon Dec 31 18:20:34 2007 -0600 @@ -30,7 +30,7 @@ ancestors[prev] = None if ancestors[badrev] is None: - return None, None + return badrev, None return badrev, ancestors good = 0 @@ -38,10 +38,10 @@ if not ancestors: # looking for bad to good transition? good = 1 badrev, ancestors = buildancestors(state['good'], state['bad']) + bad = changelog.node(badrev) if not ancestors: # now we're confused raise util.Abort(_("Inconsistent state, %s:%s is good and bad") % (badrev, hg.short(bad))) - bad = changelog.node(badrev) # build children dict children = {}
--- a/tests/test-bisect Mon Dec 31 18:20:34 2007 -0600 +++ b/tests/test-bisect Mon Dec 31 18:20:34 2007 -0600 @@ -27,6 +27,8 @@ hg bisect -b hg bisect -g 1 hg bisect -g +echo skip +hg bisect -s hg bisect -g hg bisect -g hg bisect -b @@ -37,7 +39,18 @@ hg bisect -b null hg bisect -g tip hg bisect -g +echo skip +hg bisect -s hg bisect -g hg bisect -g hg bisect -b hg bisect -g + +hg bisect -r +hg bisect -g tip +hg bisect -b tip || echo error + +hg bisect -r +hg bisect -g null +hg bisect -bU tip +hg id \ No newline at end of file
--- a/tests/test-bisect.out Mon Dec 31 18:20:34 2007 -0600 +++ b/tests/test-bisect.out Mon Dec 31 18:20:34 2007 -0600 @@ -202,7 +202,10 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -Testing changeset 27:288867a866e9 (8 changesets remaining, ~3 tests) +skip +Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests) +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -219,15 +222,22 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -Testing changeset 3:b53bea5e2fcb (8 changesets remaining, ~3 tests) +skip +Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests) +Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -Testing changeset 2:db07c04beaca (2 changesets remaining, ~1 tests) +Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests) +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved The first good revision is: -changeset: 2:db07c04beaca +changeset: 1:5cd978ea5149 user: test -date: Thu Jan 01 00:00:02 1970 +0000 -summary: msg 2 +date: Thu Jan 01 00:00:01 1970 +0000 +summary: msg 1 +abort: Inconsistent state, 31:58c80a7c8a40 is good and bad +error +Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests) +5cd978ea5149