mercurial/filemerge.py
changeset 48758 6ae3c97a0919
parent 48756 d9af7c1fb619
child 48759 86e4b86df932
--- a/mercurial/filemerge.py	Thu Feb 10 15:48:01 2022 -0800
+++ b/mercurial/filemerge.py	Fri Jan 14 08:17:13 2022 -0800
@@ -442,10 +442,13 @@
             stringutil.binary(input.text()) for input in (local, base, other)
         ):
             return 1  # continue merging
-        r = simplemerge.simplemerge(
-            ui, local, base, other, quiet=True, mode=mode
+        merged_text, conflicts = simplemerge.simplemerge(
+            ui, local, base, other, mode=mode
         )
-        if not r:
+        # fcd.flags() already has the merged flags (done in
+        # mergestate.resolve())
+        local.fctx.write(merged_text, local.fctx.flags())
+        if not conflicts:
             ui.debug(b" premerge successful\n")
             return 0
         if premerge not in validkeep:
@@ -489,8 +492,14 @@
         _verifytext(other, ui)
     except error.Abort:
         return True, True, False
-    r = simplemerge.simplemerge(ui, local, base, other, mode=mode)
-    return True, r, False
+    else:
+        merged_text, conflicts = simplemerge.simplemerge(
+            ui, local, base, other, mode=mode
+        )
+        # fcd.flags() already has the merged flags (done in
+        # mergestate.resolve())
+        local.fctx.write(merged_text, local.fctx.flags())
+        return True, conflicts, False
 
 
 @internaltool(