changeset 43253:82dabad535d2

copies: get copies information directly from _copies Performance measurement does not show any significant performance movement. This is not surprising since p1copies() code is `self._copies[0]`. Differential Revision: https://phab.mercurial-scm.org/D7121
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 16 Oct 2019 09:52:05 +0200
parents 32187ae9eeb3
children 181d28ba05da
files mercurial/copies.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Wed Oct 02 13:43:27 2019 -0400
+++ b/mercurial/copies.py	Wed Oct 16 09:52:05 2019 +0200
@@ -207,13 +207,14 @@
             return copies
         for i, c in enumerate(children[r]):
             childctx = repo[c]
+            p1copies, p2copies = childctx._copies
             if r == childctx.p1().rev():
                 parent = 1
-                childcopies = childctx.p1copies()
+                childcopies = p1copies
             else:
                 assert r == childctx.p2().rev()
                 parent = 2
-                childcopies = childctx.p2copies()
+                childcopies = p2copies
             if not alwaysmatch:
                 childcopies = {
                     dst: src for dst, src in childcopies.items() if match(dst)