mercurial/filemerge.py
changeset 6075 63e0e57ab157
parent 6025 f2335246e5c7
child 6076 0ee885fea464
equal deleted inserted replaced
6074:59a9dc9562e2 6075:63e0e57ab157
     5 # This software may be used and distributed according to the terms
     5 # This software may be used and distributed according to the terms
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 from node import *
     8 from node import *
     9 from i18n import _
     9 from i18n import _
    10 import util, os, tempfile, context, simplemerge, re
    10 import util, os, tempfile, context, simplemerge, re, filecmp
    11 
    11 
    12 def _toolstr(ui, tool, part, default=""):
    12 def _toolstr(ui, tool, part, default=""):
    13     return ui.config("merge-tools", tool + "." + part, default)
    13     return ui.config("merge-tools", tool + "." + part, default)
    14 
    14 
    15 def _toolbool(ui, tool, part, default=False):
    15 def _toolbool(ui, tool, part, default=False):
   191 
   191 
   192     if not r and _toolbool(ui, tool, "checkconflicts"):
   192     if not r and _toolbool(ui, tool, "checkconflicts"):
   193         if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcm.data()):
   193         if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcm.data()):
   194             r = 1
   194             r = 1
   195 
   195 
       
   196     if not r and _toolbool(ui, tool, "checkchanged"):
       
   197         if filecmp.cmp(repo.wjoin(fd), back):
       
   198             if ui.prompt(_(" output file %s appears unchanged\n"
       
   199                 "was merge successful (yn)?") % fd,
       
   200                 _("[yn]"), _("n")) != _("y"):
       
   201                 r = 1
       
   202 
   196     if _toolbool(ui, tool, "fixeol"):
   203     if _toolbool(ui, tool, "fixeol"):
   197         _matcheol(repo.wjoin(fd), back)
   204         _matcheol(repo.wjoin(fd), back)
   198 
   205 
   199     if r:
   206     if r:
   200         repo.ui.warn(_("merging %s failed!\n") % fd)
   207         repo.ui.warn(_("merging %s failed!\n") % fd)