From patchwork Wed Oct 16 17:34:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7072: sidedatacopies: directly fetch copies information from sidedata From: phabricator X-Patchwork-Id: 42417 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 16 Oct 2019 17:34:15 +0000 Closed by commit rHGbd62a9569f21: sidedatacopies: directly fetch copies information from sidedata (authored by marmoute). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7072?vs=17246&id=17251 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7072/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7072 AFFECTED FILES mercurial/copies.py CHANGE DETAILS To: marmoute, #hg-reviewers, martinvonz Cc: mercurial-devel diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -190,12 +190,25 @@ cl = repo.changelog parents = cl.parentrevs - def revinfo(rev): - p1, p2 = parents(rev) - ctx = repo[rev] - p1copies, p2copies = ctx._copies - removed = ctx.filesremoved() - return p1, p2, p1copies, p2copies, removed + if repo.filecopiesmode == b'changeset-sidedata': + changelogrevision = cl.changelogrevision + + def revinfo(rev): + p1, p2 = parents(rev) + c = changelogrevision(rev) + p1copies = c.p1copies + p2copies = c.p2copies + removed = c.filesremoved + return p1, p2, p1copies, p2copies, removed + + else: + + def revinfo(rev): + p1, p2 = parents(rev) + ctx = repo[rev] + p1copies, p2copies = ctx._copies + removed = ctx.filesremoved() + return p1, p2, p1copies, p2copies, removed return revinfo