changeset 49889:3aa8e569478a

merge: don't pay for pathconflicts if there are none
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Wed, 04 Jan 2023 19:13:41 +0000
parents 445b4d819e9a
children 1b701d425c37
files mercurial/merge.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)