changeset 45992:7d3c51c728c9

copies: simplify the call to _merge_copies_dict Let's get the argument into the right order, then call the function once. Differential Revision: https://phab.mercurial-scm.org/D9417
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 20 Nov 2020 10:35:42 +0100
parents cf04af3a5ef1
children c3d0b3c29ec4
files mercurial/copies.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Fri Nov 20 10:49:32 2020 +0100
+++ b/mercurial/copies.py	Fri Nov 20 10:35:42 2020 +0100
@@ -378,14 +378,11 @@
                 # changeset based copies. It was made without regards with
                 # potential filelog related behavior.
                 if parent == 1:
-                    _merge_copies_dict(
-                        othercopies, newcopies, isancestor, changes
-                    )
+                    minor, major = othercopies, newcopies
                 else:
-                    _merge_copies_dict(
-                        newcopies, othercopies, isancestor, changes
-                    )
-                    all_copies[c] = newcopies
+                    minor, major = newcopies, othercopies
+                _merge_copies_dict(minor, major, isancestor, changes)
+                all_copies[c] = minor
 
     final_copies = {}
     for dest, (tt, source) in all_copies[targetrev].items():