D7074: sidedatacopies: fast path data fetching if revision has no sidedata

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sat Oct 19 13:38:03 EDT 2019


Closed by commit rHG8a2925265402: sidedatacopies: fast path data fetching if revision has no sidedata (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7074?vs=17276&id=17358

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7074/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7074

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
@@ -192,13 +192,19 @@
 
     if repo.filecopiesmode == b'changeset-sidedata':
         changelogrevision = cl.changelogrevision
+        flags = cl.flags
 
         def revinfo(rev):
             p1, p2 = parents(rev)
-            c = changelogrevision(rev)
-            p1copies = c.p1copies
-            p2copies = c.p2copies
-            removed = c.filesremoved
+            if flags(rev) & REVIDX_SIDEDATA:
+                c = changelogrevision(rev)
+                p1copies = c.p1copies
+                p2copies = c.p2copies
+                removed = c.filesremoved
+            else:
+                p1copies = {}
+                p2copies = {}
+                removed = ()
             return p1, p2, p1copies, p2copies, removed
 
     else:



To: marmoute, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list