mercurial/filemerge.py
changeset 38793 6c8e3c847977
parent 38165 2ce60954b1b7
child 38952 0e58c5b20745
--- a/mercurial/filemerge.py	Mon Jul 02 18:39:48 2018 -0700
+++ b/mercurial/filemerge.py	Thu Jul 26 17:11:03 2018 -0700
@@ -916,14 +916,17 @@
         _haltmerge()
     # default action is 'continue', in which case we neither prompt nor halt
 
+def hasconflictmarkers(data):
+    return bool(re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", data,
+                          re.MULTILINE))
+
 def _check(repo, r, ui, tool, fcd, files):
     fd = fcd.path()
     unused, unused, unused, back = files
 
     if not r and (_toolbool(ui, tool, "checkconflicts") or
                   'conflicts' in _toollist(ui, tool, "check")):
-        if re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data(),
-                     re.MULTILINE):
+        if hasconflictmarkers(fcd.data()):
             r = 1
 
     checked = False