##// END OF EJS Templates
filemerge: add internal merge tool to dump files forcibly...
FUJIWARA Katsunori -
r32255:7e35d31b default
parent child Browse files
Show More
@@ -458,7 +458,11 b' def _idump(repo, mynode, orig, fcd, fco,'
458 perform a merge manually. If the file to be merged is named
458 perform a merge manually. If the file to be merged is named
459 ``a.txt``, these files will accordingly be named ``a.txt.local``,
459 ``a.txt``, these files will accordingly be named ``a.txt.local``,
460 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
460 ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
461 same directory as ``a.txt``."""
461 same directory as ``a.txt``.
462
463 This implies permerge. Therefore, files aren't dumped, if premerge
464 runs successfully. Use :forcedump to forcibly write files out.
465 """
462 a, b, c, back = files
466 a, b, c, back = files
463
467
464 fd = fcd.path()
468 fd = fcd.path()
@@ -468,6 +472,15 b' def _idump(repo, mynode, orig, fcd, fco,'
468 repo.wwrite(fd + ".base", fca.data(), fca.flags())
472 repo.wwrite(fd + ".base", fca.data(), fca.flags())
469 return False, 1, False
473 return False, 1, False
470
474
475 @internaltool('forcedump', mergeonly)
476 def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
477 labels=None):
478 """
479 Creates three versions of the files as same as :dump, but omits premerge.
480 """
481 return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files,
482 labels=labels)
483
471 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
484 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
472 tool, toolpath, binary, symlink = toolconf
485 tool, toolpath, binary, symlink = toolconf
473 if fcd.isabsent() or fco.isabsent():
486 if fcd.isabsent() or fco.isabsent():
@@ -1760,11 +1760,18 b' Test dynamic list of merge tools only sh'
1760 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1760 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1761 they will be placed in the same directory as "a.txt".
1761 they will be placed in the same directory as "a.txt".
1762
1762
1763 This implies permerge. Therefore, files aren't dumped, if premerge runs
1764 successfully. Use :forcedump to forcibly write files out.
1765
1763 ":fail"
1766 ":fail"
1764 Rather than attempting to merge files that were modified on both
1767 Rather than attempting to merge files that were modified on both
1765 branches, it marks them as unresolved. The resolve command must be used
1768 branches, it marks them as unresolved. The resolve command must be used
1766 to resolve these conflicts.
1769 to resolve these conflicts.
1767
1770
1771 ":forcedump"
1772 Creates three versions of the files as same as :dump, but omits
1773 premerge.
1774
1768 ":local"
1775 ":local"
1769 Uses the local 'p1()' version of files as the merged version.
1776 Uses the local 'p1()' version of files as the merged version.
1770
1777
@@ -671,6 +671,72 b' f.other:'
671 space
671 space
672 $ rm f.base f.local f.other
672 $ rm f.base f.local f.other
673
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
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
General Comments 0
You need to be logged in to leave comments. Login now