changeset 11149:d3c1eddfdbcf

merge: tool.check = prompt will force an interactive merge check tool.check = prompt can be used when the exit status of a merge tool is unreliable but an explicit user signoff on the merge result is acceptable.
author David Champion <dgc@uchicago.edu>
date Mon, 10 May 2010 11:04:56 -0500
parents a912f26777d3
children f66ca4431eb9
files doc/hgrc.5.txt mercurial/filemerge.py
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgrc.5.txt	Mon May 10 11:04:56 2010 -0500
+++ b/doc/hgrc.5.txt	Mon May 10 11:04:56 2010 -0500
@@ -470,6 +470,8 @@
     Ask whether merge was successful when the merged file shows no changes.
   ``conflicts``
     Check whether there are conflicts even though the tool reported success.
+  ``prompt``
+    Always prompt for merge success, regardless of success reported by tool.
 
 ``checkchanged``
   True is equivalent to ``check = changed``.
--- a/mercurial/filemerge.py	Mon May 10 11:04:56 2010 -0500
+++ b/mercurial/filemerge.py	Mon May 10 11:04:56 2010 -0500
@@ -231,8 +231,15 @@
         if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()):
             r = 1
 
-    if not r and (_toolbool(ui, tool, "checkchanged") or
-                  'changed' in _toollist(ui, tool, "check")):
+    checked = False
+    if 'prompt' in _toollist(ui, tool, "check"):
+        checked = True
+        if ui.promptchoice(_("was merge of '%s' successful (yn)?") % fd,
+                           (_("&Yes"), _("&No")), 1):
+            r = 1
+
+    if not r and not checked and (_toolbool(ui, tool, "checkchanged") or
+                                  'changed' in _toollist(ui, tool, "check")):
         if filecmp.cmp(repo.wjoin(fd), back):
             if ui.promptchoice(_(" output file %s appears unchanged\n"
                                  "was merge successful (yn)?") % fd,