diff mercurial/filemerge.py @ 6075:63e0e57ab157

filemerge: add 'checkchanged' merge tool property
author Steve Borho <steve@borho.org>
date Wed, 06 Feb 2008 20:32:06 -0600
parents f2335246e5c7
children 0ee885fea464
line wrap: on
line diff
--- a/mercurial/filemerge.py	Mon Feb 11 16:13:43 2008 -0600
+++ b/mercurial/filemerge.py	Wed Feb 06 20:32:06 2008 -0600
@@ -7,7 +7,7 @@
 
 from node import *
 from i18n import _
-import util, os, tempfile, context, simplemerge, re
+import util, os, tempfile, context, simplemerge, re, filecmp
 
 def _toolstr(ui, tool, part, default=""):
     return ui.config("merge-tools", tool + "." + part, default)
@@ -193,6 +193,13 @@
         if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcm.data()):
             r = 1
 
+    if not r and _toolbool(ui, tool, "checkchanged"):
+        if filecmp.cmp(repo.wjoin(fd), back):
+            if ui.prompt(_(" output file %s appears unchanged\n"
+                "was merge successful (yn)?") % fd,
+                _("[yn]"), _("n")) != _("y"):
+                r = 1
+
     if _toolbool(ui, tool, "fixeol"):
         _matcheol(repo.wjoin(fd), back)