mercurial/filemerge.py
changeset 26898 33eb8a56d0c9
parent 26893 19c4b93cb7d6
child 26941 454deda24315
--- a/mercurial/filemerge.py	Tue Nov 10 17:10:47 2015 -0800
+++ b/mercurial/filemerge.py	Tue Nov 10 17:13:16 2015 -0800
@@ -175,15 +175,19 @@
     ui = repo.ui
     fd = fcd.path()
 
-    index = ui.promptchoice(_(" no tool found to merge %s\n"
-                              "keep (l)ocal or take (o)ther?"
-                              "$$ &Local $$ &Other") % fd, 0)
-    choice = ['local', 'other'][index]
+    try:
+        index = ui.promptchoice(_(" no tool found to merge %s\n"
+                                  "keep (l)ocal or take (o)ther?"
+                                  "$$ &Local $$ &Other") % fd, 0)
+        choice = ['local', 'other'][index]
 
-    if choice == 'other':
-        return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)
-    else:
-        return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf)
+        if choice == 'other':
+            return _iother(repo, mynode, orig, fcd, fco, fca, toolconf)
+        else:
+            return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf)
+    except error.ResponseExpected:
+        ui.write("\n")
+        return 1
 
 @internaltool('local', nomerge)
 def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf):