Patchwork D3975: mergetool: warn if ui.merge points to nonexistent tool

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2018, 12:10 p.m.
Message ID <4d0b7fb17b9e77ee04456f0f176f009e@localhost.localdomain>
Download mbox | patch
Permalink /patch/33419/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2018, 12:10 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0e58c5b20745: mergetool: warn if ui.merge points to nonexistent tool (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3975?vs=9649&id=10072

REVISION DETAIL
  https://phab.mercurial-scm.org/D3975

AFFECTED FILES
  mercurial/filemerge.py
  tests/test-merge-tools.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers, lothiraldan
Cc: yuja, mercurial-devel

Patch

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.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
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -208,9 +208,10 @@ 
     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):