##// END OF EJS Templates
bisect: do not crash with rewritten commits
timeless -
r42497:52c3d16d default draft
parent child Browse files
Show More
@@ -32,6 +32,7 b' def bisect(repo, state):'
32 32 if searching for a first bad one.
33 33 """
34 34
35 repo = repo.unfiltered()
35 36 changelog = repo.changelog
36 37 clparents = changelog.parentrevs
37 38 skip = {changelog.rev(n) for n in state['skip']}
@@ -139,7 +140,7 b' def load_state(repo):'
139 140 state = {'current': [], 'good': [], 'bad': [], 'skip': []}
140 141 for l in repo.vfs.tryreadlines("bisect.state"):
141 142 kind, node = l[:-1].split()
142 node = repo.lookup(node)
143 node = repo.unfiltered().lookup(node)
143 144 if kind not in state:
144 145 raise error.Abort(_("unknown bisect kind %s") % kind)
145 146 state[kind].append(node)
@@ -184,7 +185,7 b' def get(repo, status):'
184 185 """
185 186 state = load_state(repo)
186 187 if status in ('good', 'bad', 'skip', 'current'):
187 return map(repo.changelog.rev, state[status])
188 return map(repo.unfiltered().changelog.rev, state[status])
188 189 else:
189 190 # In the following sets, we do *not* call 'bisect()' with more
190 191 # than one level of recursion, because that can be very, very
@@ -268,6 +269,7 b' def label(repo, node):'
268 269 return None
269 270
270 271 def printresult(ui, repo, state, displayer, nodes, good):
272 repo = repo.unfiltered()
271 273 if len(nodes) == 1:
272 274 # narrowed it down to a single revision
273 275 if good:
@@ -600,6 +600,129 b' tip is obsolete'
600 600 summary: msg 30
601 601
602 602
603 Rewritten commits should not crash
604
605 $ hg co 29
606 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 $ hg revert --all -r 30
608 reverting a
609 $ hg commit -m 'msg 30 -- fixed'
610 created new head
611 $ hg debugobsolete `hg id --debug -i -r 30` `hg id --debug -i -r .`
612 obsoleted 1 changesets
613 $ hg bisect
614 The first bad revision is:
615 changeset: 30:ed2d2f24b11c
616 user: test
617 date: Thu Jan 01 00:00:30 1970 +0000
618 obsolete: rewritten as 32:8a638ebd1122
619 summary: msg 30
620
621
622 Log template does not crash
623
624 $ hg log -GTbisect -r 15::
625 @ changeset: 32:8a638ebd1122
626 | bisect: good (implicit)
627 | tag: tip
628 | parent: 29:b5bd63375ab9
629 | user: test
630 | date: Thu Jan 01 00:00:00 1970 +0000
631 | summary: msg 30 -- fixed
632 |
633 o changeset: 29:b5bd63375ab9
634 | bisect: good
635 | user: test
636 | date: Thu Jan 01 00:00:29 1970 +0000
637 | summary: msg 29
638 |
639 o changeset: 28:8e0c2264c8af
640 | bisect: good
641 | user: test
642 | date: Thu Jan 01 00:00:28 1970 +0000
643 | summary: msg 28
644 |
645 o changeset: 27:288867a866e9
646 | bisect: ignored
647 | user: test
648 | date: Thu Jan 01 00:00:27 1970 +0000
649 | summary: msg 27
650 |
651 o changeset: 26:3efc6fd51aeb
652 | bisect: good
653 | user: test
654 | date: Thu Jan 01 00:00:26 1970 +0000
655 | summary: msg 26
656 |
657 o changeset: 25:02a84173a97a
658 | bisect: ignored
659 | user: test
660 | date: Thu Jan 01 00:00:25 1970 +0000
661 | summary: msg 25
662 |
663 o changeset: 24:10e0acd3809e
664 | bisect: ignored
665 | user: test
666 | date: Thu Jan 01 00:00:24 1970 +0000
667 | summary: msg 24
668 |
669 o changeset: 23:5ec79163bff4
670 | bisect: ignored
671 | user: test
672 | date: Thu Jan 01 00:00:23 1970 +0000
673 | summary: msg 23
674 |
675 o changeset: 22:06c7993750ce
676 | bisect: good
677 | user: test
678 | date: Thu Jan 01 00:00:22 1970 +0000
679 | summary: msg 22
680 |
681 o changeset: 21:e5db6aa3fe2a
682 | bisect: ignored
683 | user: test
684 | date: Thu Jan 01 00:00:21 1970 +0000
685 | summary: msg 21
686 |
687 o changeset: 20:7128fb4fdbc9
688 | bisect: ignored
689 | user: test
690 | date: Thu Jan 01 00:00:20 1970 +0000
691 | summary: msg 20
692 |
693 o changeset: 19:52798545b482
694 | bisect: ignored
695 | user: test
696 | date: Thu Jan 01 00:00:19 1970 +0000
697 | summary: msg 19
698 |
699 o changeset: 18:86977a90077e
700 | bisect: ignored
701 | user: test
702 | date: Thu Jan 01 00:00:18 1970 +0000
703 | summary: msg 18
704 |
705 o changeset: 17:03515f4a9080
706 | bisect: ignored
707 | user: test
708 | date: Thu Jan 01 00:00:17 1970 +0000
709 | summary: msg 17
710 |
711 o changeset: 16:a2e6ea4973e9
712 | bisect: ignored
713 | user: test
714 | date: Thu Jan 01 00:00:16 1970 +0000
715 | summary: msg 16
716 |
717 o changeset: 15:e7fa0811edb0
718 | bisect: good
719 ~ user: test
720 date: Thu Jan 01 00:00:15 1970 +0000
721 summary: msg 15
722
723 $ hg debugobsolete --delete `hg debugobsolete --index -T'{index}\n' | tail -1`
724 deleted 1 obsolescence markers
725
603 726 Changeset in the bad:good range is obsolete
604 727 ---------------------------------------------
605 728
General Comments 0
You need to be logged in to leave comments. Login now