Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/filemerge.py @ 32293:7d4ce4b567c5
filemerge: show warning about choice of :prompt only at an actual fallback
Before this patch, internal merge tool :prompt shows "no tool found to
merge FILE" line, even if :prompt is explicitly specified as a tool to
be used.
This patch shows warning message about choice of :prompt only at an
actual fallback, in which case any tool is rejected by capability for
binary or symlink.
It is for backward compatibility to omit warning message in
"changedelete" case.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 13 May 2017 03:28:36 +0900 |
parents | 458f7294dfee |
children | 177742666abd |
comparison
equal
deleted
inserted
replaced
32292:d67991c4fefe | 32293:7d4ce4b567c5 |
---|---|
207 toolpath = _findtool(ui, t) | 207 toolpath = _findtool(ui, t) |
208 return (t, util.shellquote(toolpath)) | 208 return (t, util.shellquote(toolpath)) |
209 | 209 |
210 # internal merge or prompt as last resort | 210 # internal merge or prompt as last resort |
211 if symlink or binary or changedelete: | 211 if symlink or binary or changedelete: |
212 if not changedelete and len(tools): | |
213 # any tool is rejected by capability for symlink or binary | |
214 ui.warn(_("no tool found to merge %s\n") % path) | |
212 return ":prompt", None | 215 return ":prompt", None |
213 return ":merge", None | 216 return ":merge", None |
214 | 217 |
215 def _eoltype(data): | 218 def _eoltype(data): |
216 "Guess the EOL type of a file" | 219 "Guess the EOL type of a file" |
258 "leave (u)nresolved?" | 261 "leave (u)nresolved?" |
259 "$$ &Changed $$ &Deleted $$ &Unresolved") % prompts, 2) | 262 "$$ &Changed $$ &Deleted $$ &Unresolved") % prompts, 2) |
260 choice = ['other', 'local', 'unresolved'][index] | 263 choice = ['other', 'local', 'unresolved'][index] |
261 else: | 264 else: |
262 index = ui.promptchoice( | 265 index = ui.promptchoice( |
263 _("no tool found to merge %(fd)s\n" | 266 _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved" |
264 "keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved?" | 267 " for %(fd)s?" |
265 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2) | 268 "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2) |
266 choice = ['local', 'other', 'unresolved'][index] | 269 choice = ['local', 'other', 'unresolved'][index] |
267 | 270 |
268 if choice == 'other': | 271 if choice == 'other': |
269 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, | 272 return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, |