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

login
register
mail settings
Submitter phabricator
Date Oct. 19, 2019, 5:38 p.m.
Message ID <cf66968fb46e86fc2f14b0359a0f68f3@localhost.localdomain>
Download mbox | patch
Permalink /patch/42503/
State Not Applicable
Headers show

Comments

phabricator - Oct. 19, 2019, 5:38 p.m.
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




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: