D7072: sidedatacopies: directly fetch copies information from sidedata

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Oct 16 13:34:15 EDT 2019


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

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