filemerge: make warning message more i18n friendly
Before this patch, " specified for " part of warning messages
(e.g. "couldn't find merge tool TOOL specified for PAT") isn't
translatable.
--- a/mercurial/filemerge.py Sat May 13 03:28:36 2017 +0900
+++ b/mercurial/filemerge.py Sat May 13 03:28:36 2017 +0900
@@ -133,7 +133,7 @@
def check(tool, pat, symlink, binary, changedelete):
tmsg = tool
if pat:
- tmsg += " specified for " + pat
+ tmsg = _("%s (for pattern %s)") % (tool, pat)
if not _findtool(ui, tool):
if pat: # explicitly requested tool deserves a warning
ui.warn(_("couldn't find merge tool %s\n") % tmsg)
--- a/tests/test-merge-tools.t Sat May 13 03:28:36 2017 +0900
+++ b/tests/test-merge-tools.t Sat May 13 03:28:36 2017 +0900
@@ -392,9 +392,9 @@
true.executable=cat
# hg update -C 1
$ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
- couldn't find merge tool true specified for f
+ couldn't find merge tool true (for pattern f)
merging f
- couldn't find merge tool true specified for f
+ couldn't find merge tool true (for pattern f)
merging f failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
@@ -418,9 +418,9 @@
true.executable=cat
# hg update -C 1
$ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
- couldn't find merge tool true specified for f
+ couldn't find merge tool true (for pattern f)
merging f
- couldn't find merge tool true specified for f
+ couldn't find merge tool true (for pattern f)
merging f failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon