comparison tests/test-merge-tools.t @ 32255:7e35d31b41fd

filemerge: add internal merge tool to dump files forcibly Internal merge tool :dump implies premerge. Therefore, files aren't dumped, if premerge runs successfully. This undocumented behavior might confuse users, if they want to always dump files. But just making :dump omit premerge might cause backward compatibility issue for existing automation. This patch adds new internal merge tool :forcedump, which works as same as :dump, but omits premerge always. Internal tools annotated with "nomerge" should merge "change and delete" correctly, but _forcedump() can't. Therefore, it is annotated with "mergeonly" to always omit premerge, even though it doesn't merge files actually. This patch also adds explanation about premerge to :dump, to clarify how :dump actually works. BTW, this patch specifies internal tools with "internal:" prefix in newly added test scenario in test-merge-tools.t, even though this prefix is already deprecated. This is only for similarity to other tests in test-merge-tools.t.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 13 May 2017 03:31:42 +0900
parents 177742666abd
children 9bc36198338e
comparison
equal deleted inserted replaced
32254:177742666abd 32255:7e35d31b41fd
668 668
669 $ cat f.other 669 $ cat f.other
670 revision 2 670 revision 2
671 space 671 space
672 $ rm f.base f.local f.other 672 $ rm f.base f.local f.other
673
674 check that internal:dump doesn't dump files if premerge runs
675 successfully
676
677 $ beforemerge
678 [merge-tools]
679 false.whatever=
680 true.priority=1
681 true.executable=cat
682 # hg update -C 1
683 $ hg merge -r 3 --config ui.merge=internal:dump
684 merging f
685 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
686 (branch merge, don't forget to commit)
687
688 $ aftermerge
689 # cat f
690 revision 1
691 space
692 revision 3
693 # hg stat
694 M f
695 # hg resolve --list
696 R f
697
698 check that internal:forcedump dumps files, even if local and other can
699 be merged easily
700
701 $ beforemerge
702 [merge-tools]
703 false.whatever=
704 true.priority=1
705 true.executable=cat
706 # hg update -C 1
707 $ hg merge -r 3 --config ui.merge=internal:forcedump
708 merging f
709 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
710 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
711 [1]
712 $ aftermerge
713 # cat f
714 revision 1
715 space
716 # hg stat
717 M f
718 ? f.base
719 ? f.local
720 ? f.orig
721 ? f.other
722 # hg resolve --list
723 U f
724
725 $ cat f.base
726 revision 0
727 space
728
729 $ cat f.local
730 revision 1
731 space
732
733 $ cat f.other
734 revision 0
735 space
736 revision 3
737
738 $ rm -f f.base f.local f.other
673 739
674 ui.merge specifies internal:other but is overruled by pattern for false: 740 ui.merge specifies internal:other but is overruled by pattern for false:
675 741
676 $ beforemerge 742 $ beforemerge
677 [merge-tools] 743 [merge-tools]