# HG changeset patch # User Arseniy Alekseyev # Date 2023-01-04 19:13:41 # Node ID 3aa8e569478a7229d953cb2a82744a773ff71e59 # Parent 445b4d819e9af9ba433e4dcc40bc8a89520379b9 merge: don't pay for pathconflicts if there are none diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -245,8 +245,11 @@ def _checkunknownfiles(repo, wctx, mctx, ): 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)