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

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Oct 16 18:56:04 EDT 2019


marmoute edited the summary of this revision.
marmoute updated this revision to Diff 17276.

REPOSITORY
  rHG Mercurial

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

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