diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -208,9 +208,10 @@ def _picktool(repo, ui, path, binary, sy if uimerge: # external tools defined in uimerge won't be able to handle # change/delete conflicts - if uimerge not in names and not changedelete: - return (uimerge, uimerge) - tools.insert(0, (None, uimerge)) # highest priority + if check(uimerge, path, symlink, binary, changedelete): + if uimerge not in names and not changedelete: + return (uimerge, uimerge) + tools.insert(0, (None, uimerge)) # highest priority tools.append((None, "hgmerge")) # the old default, if found for p, t in tools: if check(t, None, symlink, binary, changedelete): diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t --- a/tests/test-merge-tools.t +++ b/tests/test-merge-tools.t @@ -1748,7 +1748,9 @@ missingbinary is a merge-tool that doesn missingbinary.executable=doesnotexist # hg update -C 1 $ hg merge -y -r 2 --config ui.merge=missingbinary + couldn't find merge tool missingbinary (for pattern f) merging f + couldn't find merge tool missingbinary (for pattern f) revision 1 space revision 0