# HG changeset patch # User Pierre-Yves David # Date 2020-11-20 09:51:07 # Node ID 8d54944eaeb0642fa428020b5da88a56dcb5b184 # Parent 6c960b708ac499371503b30ccb51e647e3fa4a7d copies: properly copies parent dictionary before updating it This enforces the copy on write logic. Otherwise independant unrelated branches could affected each other. More testing of these case are coming, but I need that code landed to unlock other performance work in parallel. Differential Revision: https://phab.mercurial-scm.org/D9419 diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -380,9 +380,14 @@ def _combine_changeset_copies( # changeset based copies. It was made without regards with # potential filelog related behavior. if parent == 1: + if newcopies is copies: + newcopies = copies.copy() minor, major = othercopies, newcopies else: - minor, major = newcopies, othercopies + # we do not know if the other dict is a copy or not, so we + # need to blindly copy it. Future change should make this + # unnecessary. + minor, major = newcopies, othercopies.copy() copies = _merge_copies_dict(minor, major, isancestor, changes) all_copies[c] = copies