filemerge: add internal:prompt target
authorMatt Mackall <mpm@selenic.com>
Thu, 18 Jun 2009 16:56:02 -0500
changeset 8830 a9850eda2973
parent 8829 ce4b92f5cea7
child 8831 91e26fb24fb1
filemerge: add internal:prompt target
mercurial/filemerge.py
--- a/mercurial/filemerge.py	Thu Jun 18 10:39:04 2009 +0100
+++ b/mercurial/filemerge.py	Thu Jun 18 16:56:02 2009 -0500
@@ -16,8 +16,10 @@
 def _toolbool(ui, tool, part, default=False):
     return ui.configbool("merge-tools", tool + "." + part, default)
 
+_internal = ['internal:' + s for s in 'fail local other merge prompt'.split()]
+
 def _findtool(ui, tool):
-    if tool in ("internal:fail", "internal:local", "internal:other"):
+    if tool in _internal:
         return tool
     k = _toolstr(ui, tool, "regkey")
     if k:
@@ -140,7 +142,7 @@
     ui.debug(_("picked tool '%s' for %s (binary %s symlink %s)\n") %
                (tool, fd, binary, symlink))
 
-    if not tool:
+    if not tool or tool == 'internal:prompt':
         tool = "internal:local"
         if ui.prompt(_(" no tool found to merge %s\n"
                        "keep (l)ocal or take (o)ther?") % fd,