comparison tests/test-rebase-obsolete.t @ 28686:b212e01fead0

rebase: fix crash when rebase aborts while rebasing obsolete revisions Before this patch, rebase --continue would crash when trying to resume a rebase of obsolete revisions whose successors were in the destination. This patch adds logic to recompute the mapping when rebase is resumed. This patch also adds a test that showcased the crash before the code change.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 29 Mar 2016 11:50:41 -0700
parents a47881680402
children 8ede973597fd
comparison
equal deleted inserted replaced
28685:6c4d23fe611c 28686:b212e01fead0
803 commit: (clean) 803 commit: (clean)
804 update: 1 new changesets, 2 branch heads (merge) 804 update: 1 new changesets, 2 branch heads (merge)
805 phases: 8 draft 805 phases: 8 draft
806 divergent: 2 changesets 806 divergent: 2 changesets
807 807
808 rebase --continue + skipped rev because their successors are in destination
809 we make a change in trunk and work on conflicting changes to make rebase abort.
810
811 $ hg log -G -r 17::
812 @ 17:61bd55f69bc4 bar foo
813 |
814 ~
815
816 Create the two changes in trunk
817 $ printf "a" > willconflict
818 $ hg add willconflict
819 $ hg commit -m "willconflict first version"
820
821 $ printf "dummy" > C
822 $ hg commit -m "dummy change successor"
823
824 Create the changes that we will rebase
825 $ hg update -C 17 -q
826 $ printf "b" > willconflict
827 $ hg add willconflict
828 $ hg commit -m "willconflict second version"
829 created new head
830 $ printf "dummy" > K
831 $ hg add K
832 $ hg commit -m "dummy change"
833 $ printf "dummy" > L
834 $ hg add L
835 $ hg commit -m "dummy change"
836 $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 19 -T '{node}'` --config experimental.evolution=all
837
838 $ hg log -G -r 17::
839 @ 22:7bdc8a87673d dummy change
840 |
841 x 21:8b31da3c4919 dummy change
842 |
843 o 20:b82fb57ea638 willconflict second version
844 |
845 | o 19:601db7a18f51 dummy change successor
846 | |
847 | o 18:357ddf1602d5 willconflict first version
848 |/
849 o 17:61bd55f69bc4 bar foo
850 |
851 ~
852 $ hg rebase -r ".^^ + .^ + ." -d 19
853 rebasing 20:b82fb57ea638 "willconflict second version"
854 merging willconflict
855 warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
856 unresolved conflicts (see hg resolve, then hg rebase --continue)
857 [1]
858
859 $ hg resolve --mark willconflict
860 (no more unresolved files)
861 continue: hg rebase --continue
862 $ hg rebase --continue
863 rebasing 20:b82fb57ea638 "willconflict second version"
864 note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
865 rebasing 22:7bdc8a87673d "dummy change" (tip)