Patchwork D9417: copies: simplify the call to _merge_copies_dict

login
register
mail settings
Submitter phabricator
Date Nov. 27, 2020, 4:11 p.m.
Message ID <differential-rev-PHID-DREV-od6ey7d3n5rpwo6f2h6r-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47696/
State Superseded
Headers show

Comments

phabricator - Nov. 27, 2020, 4:11 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Let's get the argument into the right order, then call the function once.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9417

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -405,14 +405,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():