merge: don't pay for pathconflicts if there are none
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Wed, 04 Jan 2023 19:13:41 +0000
changeset 49889 3aa8e569478a
parent 49888 445b4d819e9a
child 49890 1b701d425c37
merge: don't pay for pathconflicts if there are none
mercurial/merge.py
--- a/mercurial/merge.py	Fri Jan 06 16:27:31 2023 +0000
+++ b/mercurial/merge.py	Wed Jan 04 19:13:41 2023 +0000
@@ -245,8 +245,11 @@
     ):
         backup = (
             f in fileconflicts
-            or f in pathconflicts
-            or any(p in pathconflicts for p in pathutil.finddirs(f))
+            or pathconflicts
+            and (
+                f in pathconflicts
+                or any(p in pathconflicts for p in pathutil.finddirs(f))
+            )
         )
         (flags,) = args
         mresult.addfile(f, mergestatemod.ACTION_GET, (flags, backup), msg)