diff -r afb442f58cbf -r 6c8e3c847977 mercurial/filemerge.py --- 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