comparison tests/test-merge-tools.t @ 39124:6618634e3325

filemerge: show warning if chosen tool has no binary files capability While matching patterns in "merge-patterns" configuration, Mercurial silently assumes that all merge tools have binary files capability. This implementation comes from 5af5f0f9d724 (or Mercurial 1.0). At failure of merging binary files with incorrect internal merge tool, there is no hint about this silent ignorance of binary files capability. This patch shows warning message, if chosen internal merge tool has no binary files capability. This will help users to investigate why a binary file isn't merged as expected.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 15 Aug 2018 22:24:38 +0900
parents 0e58c5b20745
children cded904f7acc
comparison
equal deleted inserted replaced
39123:4d7b11877dd0 39124:6618634e3325
1803 merging f and f.txt to f.txt 1803 merging f and f.txt to f.txt
1804 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob) 1804 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1805 0 files updated, 1 files merged, 0 files removed, 0 files unresolved 1805 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1806 (branch merge, don't forget to commit) 1806 (branch merge, don't forget to commit)
1807 1807
1808 Binary files capability checking
1809
1810 $ hg update -q -C 0
1811 $ python <<EOF
1812 > with open('b', 'wb') as fp:
1813 > fp.write(b'\x00\x01\x02\x03')
1814 > EOF
1815 $ hg add b
1816 $ hg commit -qm "add binary file (#1)"
1817
1818 $ hg update -q -C 0
1819 $ python <<EOF
1820 > with open('b', 'wb') as fp:
1821 > fp.write(b'\x03\x02\x01\x00')
1822 > EOF
1823 $ hg add b
1824 $ hg commit -qm "add binary file (#2)"
1825
1826 By default, binary files capability of internal merge tools is not
1827 checked strictly.
1828
1829 (for merge-patterns, chosen unintentionally)
1830
1831 $ hg merge 9 \
1832 > --config merge-patterns.b=:merge-other \
1833 > --config merge-patterns.re:[a-z]=:other
1834 warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional
1835 (see 'hg help merge-tools' for binary files capability)
1836 merging b
1837 warning: b looks like a binary file.
1838 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1839 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1840 [1]
1841 $ hg merge --abort -q
1842
1808 Check that debugpicktool examines which merge tool is chosen for 1843 Check that debugpicktool examines which merge tool is chosen for
1809 specified file as expected 1844 specified file as expected
1810 1845
1811 $ beforemerge 1846 $ beforemerge
1812 [merge-tools] 1847 [merge-tools]
1834 $ hg debugpickmergetool --changedelete 1869 $ hg debugpickmergetool --changedelete
1835 f = :prompt 1870 f = :prompt
1836 1871
1837 (-r REV causes checking files in specified revision) 1872 (-r REV causes checking files in specified revision)
1838 1873
1839 $ hg manifest -r tip 1874 $ hg manifest -r 8
1840 f.txt 1875 f.txt
1841 $ hg debugpickmergetool -r tip 1876 $ hg debugpickmergetool -r 8
1842 f.txt = true 1877 f.txt = true
1843 1878
1844 #if symlink 1879 #if symlink
1845 1880
1846 (symlink causes chosing :prompt) 1881 (symlink causes chosing :prompt)