From patchwork Wed Oct 16 21:49:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7122: copies: avoid instancing more changectx to access parent revisions From: phabricator X-Patchwork-Id: 42438 Message-Id: <370fbe6ff72fb86f38301fbb858e72fd@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 16 Oct 2019 21:49:57 +0000 marmoute updated this revision to Diff 17272. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7122?vs=17248&id=17272 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7122/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7122 AFFECTED FILES mercurial/copies.py CHANGE DETAILS To: marmoute, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -207,12 +207,13 @@ return copies for i, c in enumerate(children[r]): childctx = repo[c] + p1, p2 = cl.parentrevs(c) p1copies, p2copies = childctx._copies - if r == childctx.p1().rev(): + if r == p1: parent = 1 childcopies = p1copies else: - assert r == childctx.p2().rev() + assert r == p2 parent = 2 childcopies = p2copies if not alwaysmatch: