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

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 10:56 p.m.
Message ID <4351a30a688dccb136ab87f0638eddf4@localhost.localdomain>
Download mbox | patch
Permalink /patch/42442/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2019, 10:56 p.m.
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




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

Patch

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: