mercurial/filemerge.py
branchstable
changeset 47874 053dd53a0b59
parent 47055 d55b71393907
child 48395 1eeec02cd919
--- a/mercurial/filemerge.py	Mon Aug 30 23:40:43 2021 +0530
+++ b/mercurial/filemerge.py	Tue Sep 07 11:50:12 2021 -0700
@@ -1212,9 +1212,13 @@
 
 
 def hasconflictmarkers(data):
+    # Detect lines starting with a string of 7 identical characters from the
+    # subset Mercurial uses for conflict markers, followed by either the end of
+    # line or a space and some text. Note that using [<>=+|-]{7} would detect
+    # `<><><><><` as a conflict marker, which we don't want.
     return bool(
         re.search(
-            br"^(<<<<<<<.*|=======.*|------- .*|\+\+\+\+\+\+\+ .*|>>>>>>>.*)$",
+            br"^([<>=+|-])\1{6}( .*)$",
             data,
             re.MULTILINE,
         )