##// END OF EJS Templates
filemerge: show warning if chosen tool has no binary files capability...
FUJIWARA Katsunori -
r39160:6618634e default
parent child Browse files
Show More
@@ -195,6 +195,12 b' def _picktool(repo, ui, path, binary, sy'
195 195 for pat, tool in ui.configitems("merge-patterns"):
196 196 mf = match.match(repo.root, '', [pat])
197 197 if mf(path) and check(tool, pat, symlink, False, changedelete):
198 if binary and not hascapability(tool, "binary", strict=True):
199 ui.warn(_("warning: check merge-patterns configurations,"
200 " if %r for binary file %r is unintentional\n"
201 "(see 'hg help merge-tools'"
202 " for binary files capability)\n")
203 % (pycompat.bytestr(tool), pycompat.bytestr(path)))
198 204 toolpath = _findtool(ui, tool)
199 205 return (tool, _quotetoolpath(toolpath))
200 206
@@ -1805,6 +1805,41 b' Verify naming of temporary files and tha'
1805 1805 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1806 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 1843 Check that debugpicktool examines which merge tool is chosen for
1809 1844 specified file as expected
1810 1845
@@ -1836,9 +1871,9 b' specified file as expected'
1836 1871
1837 1872 (-r REV causes checking files in specified revision)
1838 1873
1839 $ hg manifest -r tip
1874 $ hg manifest -r 8
1840 1875 f.txt
1841 $ hg debugpickmergetool -r tip
1876 $ hg debugpickmergetool -r 8
1842 1877 f.txt = true
1843 1878
1844 1879 #if symlink
General Comments 0
You need to be logged in to leave comments. Login now