copies: get copies information directly from _copies
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 16 Oct 2019 09:52:05 +0200
changeset 43253 82dabad535d2
parent 43252 32187ae9eeb3
child 43254 181d28ba05da
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
mercurial/copies.py
--- 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)