Show More
@@ -667,12 +667,13 b' def bisect(ui, repo, rev=None, extra=Non' | |||||
667 |
|
667 | |||
668 | if command: |
|
668 | if command: | |
669 | changesets = 1 |
|
669 | changesets = 1 | |
670 |
|
|
670 | if noupdate: | |
671 | node = state['current'][0] |
|
671 | try: | |
672 | except LookupError: |
|
672 | node = state['current'][0] | |
673 |
|
|
673 | except LookupError: | |
674 | raise util.Abort(_('current bisect revision is unknown - ' |
|
674 | raise util.Abort(_('current bisect revision is unknown - ' | |
675 | 'start a new bisect to fix')) |
|
675 | 'start a new bisect to fix')) | |
|
676 | else: | |||
676 | node, p2 = repo.dirstate.parents() |
|
677 | node, p2 = repo.dirstate.parents() | |
677 | if p2 != nullid: |
|
678 | if p2 != nullid: | |
678 | raise util.Abort(_('current bisect revision is a merge')) |
|
679 | raise util.Abort(_('current bisect revision is a merge')) |
@@ -461,11 +461,14 b' test bisecting command' | |||||
461 | > EOF |
|
461 | > EOF | |
462 | $ chmod +x script.py |
|
462 | $ chmod +x script.py | |
463 | $ hg bisect -r |
|
463 | $ hg bisect -r | |
464 |
$ hg |
|
464 | $ hg up -qr tip | |
465 | $ hg bisect --bad 0 |
|
|||
466 | Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests) |
|
|||
467 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
468 | $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters" |
|
465 | $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters" | |
|
466 | changeset 31:58c80a7c8a40: good | |||
|
467 | abort: cannot bisect (no known bad revisions) | |||
|
468 | [255] | |||
|
469 | $ hg up -qr 0 | |||
|
470 | $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters" | |||
|
471 | changeset 0:b99c7b9c8e11: bad | |||
469 | changeset 15:e7fa0811edb0: good |
|
472 | changeset 15:e7fa0811edb0: good | |
470 | changeset 7:03750880c6b5: good |
|
473 | changeset 7:03750880c6b5: good | |
471 | changeset 3:b53bea5e2fcb: bad |
|
474 | changeset 3:b53bea5e2fcb: bad | |
@@ -516,6 +519,39 b" ensure that we still don't have a workin" | |||||
516 | $ hg parents |
|
519 | $ hg parents | |
517 |
|
520 | |||
518 |
|
521 | |||
|
522 | test the same case, this time with updating | |||
|
523 | ||||
|
524 | $ cat > script.sh <<'EOF' | |||
|
525 | > #!/bin/sh | |||
|
526 | > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127) | |||
|
527 | > current="`hg log -r \"bisect(current)\" --template {node}`" | |||
|
528 | > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127) | |||
|
529 | > rev="`hg log -r . --template {rev}`" | |||
|
530 | > test "$rev" -ge 6 | |||
|
531 | > EOF | |||
|
532 | $ chmod +x script.sh | |||
|
533 | $ hg bisect -r | |||
|
534 | $ hg up -qr tip | |||
|
535 | $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" | |||
|
536 | changeset 31:58c80a7c8a40: good | |||
|
537 | abort: cannot bisect (no known bad revisions) | |||
|
538 | [255] | |||
|
539 | $ hg up -qr 0 | |||
|
540 | $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" | |||
|
541 | changeset 0:b99c7b9c8e11: bad | |||
|
542 | changeset 15:e7fa0811edb0: good | |||
|
543 | changeset 7:03750880c6b5: good | |||
|
544 | changeset 3:b53bea5e2fcb: bad | |||
|
545 | changeset 5:7874a09ea728: bad | |||
|
546 | changeset 6:a3d5c6fdf0d3: good | |||
|
547 | The first good revision is: | |||
|
548 | changeset: 6:a3d5c6fdf0d3 | |||
|
549 | user: test | |||
|
550 | date: Thu Jan 01 00:00:06 1970 +0000 | |||
|
551 | summary: msg 6 | |||
|
552 | ||||
|
553 | ||||
|
554 | ||||
519 | Check that bisect does not break on obsolete changesets |
|
555 | Check that bisect does not break on obsolete changesets | |
520 | ========================================================= |
|
556 | ========================================================= | |
521 |
|
557 |
General Comments 0
You need to be logged in to leave comments.
Login now