Skip to content
Snippets Groups Projects
Commit 8d54944e authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

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
parent 6c960b70
No related branches found
No related tags found
No related merge requests found
...@@ -380,5 +380,7 @@ ...@@ -380,5 +380,7 @@
# changeset based copies. It was made without regards with # changeset based copies. It was made without regards with
# potential filelog related behavior. # potential filelog related behavior.
if parent == 1: if parent == 1:
if newcopies is copies:
newcopies = copies.copy()
minor, major = othercopies, newcopies minor, major = othercopies, newcopies
else: else:
...@@ -383,6 +385,9 @@ ...@@ -383,6 +385,9 @@
minor, major = othercopies, newcopies minor, major = othercopies, newcopies
else: 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) copies = _merge_copies_dict(minor, major, isancestor, changes)
all_copies[c] = copies all_copies[c] = copies
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment