mercurial/filemerge.py
changeset 38793 6c8e3c847977
parent 38165 2ce60954b1b7
child 38952 0e58c5b20745
equal deleted inserted replaced
38792:afb442f58cbf 38793:6c8e3c847977
   914             _haltmerge()
   914             _haltmerge()
   915     if action == 'halt':
   915     if action == 'halt':
   916         _haltmerge()
   916         _haltmerge()
   917     # default action is 'continue', in which case we neither prompt nor halt
   917     # default action is 'continue', in which case we neither prompt nor halt
   918 
   918 
       
   919 def hasconflictmarkers(data):
       
   920     return bool(re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", data,
       
   921                           re.MULTILINE))
       
   922 
   919 def _check(repo, r, ui, tool, fcd, files):
   923 def _check(repo, r, ui, tool, fcd, files):
   920     fd = fcd.path()
   924     fd = fcd.path()
   921     unused, unused, unused, back = files
   925     unused, unused, unused, back = files
   922 
   926 
   923     if not r and (_toolbool(ui, tool, "checkconflicts") or
   927     if not r and (_toolbool(ui, tool, "checkconflicts") or
   924                   'conflicts' in _toollist(ui, tool, "check")):
   928                   'conflicts' in _toollist(ui, tool, "check")):
   925         if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
   929         if hasconflictmarkers(fcd.data()):
   926                      re.MULTILINE):
       
   927             r = 1
   930             r = 1
   928 
   931 
   929     checked = False
   932     checked = False
   930     if 'prompt' in _toollist(ui, tool, "check"):
   933     if 'prompt' in _toollist(ui, tool, "check"):
   931         checked = True
   934         checked = True