D7072: sidedatacopies: directly fetch copies information from sidedata
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Oct 16 17:50:15 EDT 2019
marmoute updated this revision to Diff 17275.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D7072?vs=17251&id=17275
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
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
To: marmoute, #hg-reviewers, martinvonz
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list