Show More
@@ -38,7 +38,7 b' def bisect(changelog, state):' | |||||
38 | # set nodes descended from goodrevs |
|
38 | # set nodes descended from goodrevs | |
39 | for rev in goodrevs: |
|
39 | for rev in goodrevs: | |
40 | ancestors[rev] = [] |
|
40 | ancestors[rev] = [] | |
41 |
for rev in |
|
41 | for rev in changelog.revs(goodrev + 1): | |
42 | for prev in clparents(rev): |
|
42 | for prev in clparents(rev): | |
43 | if ancestors[prev] == []: |
|
43 | if ancestors[prev] == []: | |
44 | ancestors[rev] = [] |
|
44 | ancestors[rev] = [] | |
@@ -46,7 +46,7 b' def bisect(changelog, state):' | |||||
46 | # clear good revs from array |
|
46 | # clear good revs from array | |
47 | for rev in goodrevs: |
|
47 | for rev in goodrevs: | |
48 | ancestors[rev] = None |
|
48 | ancestors[rev] = None | |
49 |
for rev in |
|
49 | for rev in changelog.revs(len(changelog), goodrev): | |
50 | if ancestors[rev] is None: |
|
50 | if ancestors[rev] is None: | |
51 | for prev in clparents(rev): |
|
51 | for prev in clparents(rev): | |
52 | ancestors[prev] = None |
|
52 | ancestors[prev] = None |
@@ -508,3 +508,58 b' command' | |||||
508 | ensure that we still don't have a working dir |
|
508 | ensure that we still don't have a working dir | |
509 |
|
509 | |||
510 | $ hg parents |
|
510 | $ hg parents | |
|
511 | ||||
|
512 | ||||
|
513 | Check that bisect does not break on obsolete changesets | |||
|
514 | ========================================================= | |||
|
515 | ||||
|
516 | $ cat > ${TESTTMP}/obs.py << EOF | |||
|
517 | > import mercurial.obsolete | |||
|
518 | > mercurial.obsolete._enabled = True | |||
|
519 | > EOF | |||
|
520 | $ echo '[extensions]' >> $HGRCPATH | |||
|
521 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH | |||
|
522 | ||||
|
523 | tip is obsolete | |||
|
524 | --------------------- | |||
|
525 | ||||
|
526 | $ hg debugobsolete `hg id --debug -i -r tip` | |||
|
527 | $ hg bisect --reset | |||
|
528 | $ hg bisect --good 15 | |||
|
529 | $ hg bisect --bad 30 | |||
|
530 | Testing changeset 22:06c7993750ce (15 changesets remaining, ~3 tests) | |||
|
531 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
532 | $ hg bisect --command true | |||
|
533 | changeset 22:06c7993750ce: good | |||
|
534 | changeset 26:3efc6fd51aeb: good | |||
|
535 | changeset 28:8e0c2264c8af: good | |||
|
536 | changeset 29:b5bd63375ab9: good | |||
|
537 | The first bad revision is: | |||
|
538 | changeset: 30:ed2d2f24b11c | |||
|
539 | tag: tip | |||
|
540 | user: test | |||
|
541 | date: Thu Jan 01 00:00:30 1970 +0000 | |||
|
542 | summary: msg 30 | |||
|
543 | ||||
|
544 | ||||
|
545 | Changeset in the bad:good range is obsolete | |||
|
546 | --------------------------------------------- | |||
|
547 | ||||
|
548 | $ hg up 30 | |||
|
549 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
550 | $ echo 'a' >> a | |||
|
551 | $ hg ci -m "msg 32" -d "32 0" | |||
|
552 | $ hg bisect --reset | |||
|
553 | $ hg bisect --good . | |||
|
554 | $ hg bisect --bad 25 | |||
|
555 | Testing changeset 28:8e0c2264c8af (6 changesets remaining, ~2 tests) | |||
|
556 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
557 | $ hg bisect --command true | |||
|
558 | changeset 28:8e0c2264c8af: good | |||
|
559 | changeset 26:3efc6fd51aeb: good | |||
|
560 | The first good revision is: | |||
|
561 | changeset: 26:3efc6fd51aeb | |||
|
562 | user: test | |||
|
563 | date: Thu Jan 01 00:00:26 1970 +0000 | |||
|
564 | summary: msg 26 | |||
|
565 |
General Comments 0
You need to be logged in to leave comments.
Login now