# HG changeset patch # User Pierre-Yves David # Date 2020-10-01 07:45:00 # Node ID 7990e7d957b01b3639f11b1d597cbe400e78d5b3 # Parent f877b3628015b76f790798ea5c2af82b04d57430 copies: move `merged` testing sooner previously `is_merged` was an expensive callback. Now that all this data is pre-computed, this is is a simple membership testing. So it is probably cheaper than the membership testing. Differential Revision: https://phab.mercurial-scm.org/D9141 diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -397,9 +397,9 @@ def _merge_copies_dict(minor, major, isa and dest in changes.salvaged ): minor[dest] = value - elif not isancestor(new_tt, other_tt): + elif changes is not None and dest in changes.merged: minor[dest] = value - elif changes is not None and dest in changes.merged: + elif not isancestor(new_tt, other_tt): minor[dest] = value