##// END OF EJS Templates
tests: add some more tests to test-rebase-collapse.t...
Martin von Zweigbergk -
r37048:9cc9b3e1 default
parent child Browse files
Show More
@@ -324,6 +324,76 b' Preserves external parent'
324
324
325 $ cd ..
325 $ cd ..
326
326
327 Rebasing from multiple bases:
328
329 $ hg init multiple-bases
330 $ cd multiple-bases
331 $ hg debugdrawdag << 'EOF'
332 > C B
333 > D |/
334 > |/
335 > A
336 > EOF
337 $ hg rebase --collapse -r 'B+C' -d D
338 rebasing 1:fc2b737bb2e5 "B" (B)
339 rebasing 2:dc0947a82db8 "C" (C)
340 saved backup bundle to $TESTTMP/multiple-bases/.hg/strip-backup/dc0947a82db8-b0c1a7ea-rebase.hg
341 $ hg tglog
342 o 2: 2127ae44d291 'Collapsed revision
343 | * B
344 | * C'
345 o 1: b18e25de2cf5 'D'
346 |
347 o 0: 426bada5c675 'A'
348
349 $ cd ..
350
351 With non-contiguous commits:
352
353 $ hg init non-contiguous
354 $ cd non-contiguous
355 $ cat >> .hg/hgrc <<EOF
356 > [experimental]
357 > evolution=all
358 > EOF
359
360 $ hg debugdrawdag << 'EOF'
361 > F
362 > |
363 > E
364 > |
365 > D
366 > |
367 > C
368 > |
369 > B G
370 > |/
371 > A
372 > EOF
373
374 BROKEN: should be allowed
375 $ hg rebase --collapse -r 'B+D+F' -d G
376 abort: unable to collapse on top of 2, there is more than one external parent: 3, 5
377 [255]
378 $ cd ..
379
380
381 $ hg init multiple-external-parents-2
382 $ cd multiple-external-parents-2
383 $ hg debugdrawdag << 'EOF'
384 > D G
385 > |\ /|
386 > B C E F
387 > \| |/
388 > \ H /
389 > \|/
390 > A
391 > EOF
392
393 $ hg rebase --collapse -d H -s 'B+F'
394 abort: unable to collapse on top of 5, there is more than one external parent: 1, 3
395 [255]
396 $ cd ..
327
397
328 With internal merge:
398 With internal merge:
329
399
@@ -660,3 +730,102 b' running into merge conflict and invoking'
660 summary: A
730 summary: A
661
731
662 $ cd ..
732 $ cd ..
733
734 Test aborted editor on final message
735
736 $ HGMERGE=:merge3
737 $ export HGMERGE
738 $ hg init aborted-editor
739 $ cd aborted-editor
740 $ hg debugdrawdag << 'EOF'
741 > C # D/A = D\n
742 > | # C/A = C\n
743 > B D # B/A = B\n
744 > |/ # A/A = A\n
745 > A
746 > EOF
747 $ hg rebase --collapse -t internal:merge3 -s B -d D
748 rebasing 1:f899f3910ce7 "B" (B)
749 merging A
750 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
751 unresolved conflicts (see hg resolve, then hg rebase --continue)
752 [1]
753 $ hg tglog
754 o 3: 63668d570d21 'C'
755 |
756 | @ 2: 82b8abf9c185 'D'
757 | |
758 @ | 1: f899f3910ce7 'B'
759 |/
760 o 0: 4a2df7238c3b 'A'
761
762 $ cat A
763 <<<<<<< dest: 82b8abf9c185 D - test: D
764 D
765 ||||||| base
766 A
767 =======
768 B
769 >>>>>>> source: f899f3910ce7 B - test: B
770 $ echo BC > A
771 $ hg resolve -m
772 (no more unresolved files)
773 continue: hg rebase --continue
774 $ hg rebase --continue
775 rebasing 1:f899f3910ce7 "B" (B)
776 rebasing 3:63668d570d21 "C" (C tip)
777 merging A
778 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
779 unresolved conflicts (see hg resolve, then hg rebase --continue)
780 [1]
781 $ hg tglog
782 @ 3: 63668d570d21 'C'
783 |
784 | @ 2: 82b8abf9c185 'D'
785 | |
786 o | 1: f899f3910ce7 'B'
787 |/
788 o 0: 4a2df7238c3b 'A'
789
790 $ cat A
791 <<<<<<< dest: 82b8abf9c185 D - test: D
792 BC
793 ||||||| base
794 B
795 =======
796 C
797 >>>>>>> source: 63668d570d21 C tip - test: C
798 $ echo BD > A
799 $ hg resolve -m
800 (no more unresolved files)
801 continue: hg rebase --continue
802 $ HGEDITOR=false hg rebase --continue --config ui.interactive=1
803 already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185
804 rebasing 3:63668d570d21 "C" (C tip)
805 abort: edit failed: false exited with status 1
806 [255]
807 $ hg tglog
808 o 3: 63668d570d21 'C'
809 |
810 | @ 2: 82b8abf9c185 'D'
811 | |
812 o | 1: f899f3910ce7 'B'
813 |/
814 o 0: 4a2df7238c3b 'A'
815
816 BROKEN: should not result in a conflict
817 $ hg rebase --continue
818 already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185
819 rebasing 3:63668d570d21 "C" (C tip)
820 merging A
821 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
822 unresolved conflicts (see hg resolve, then hg rebase --continue)
823 [1]
824 $ cat A
825 <<<<<<< dest: 82b8abf9c185 D - test: D
826 BD
827 ||||||| base
828 B
829 =======
830 C
831 >>>>>>> source: 63668d570d21 C tip - test: C
General Comments 0
You need to be logged in to leave comments. Login now