changeset 45639:7a757e893532

copies: no longer change the sidedata flag With the new sidedata storage that include data about all file changes, every revision has one, so the sidedata flag is not longer a good way to spot changeset with copy information. So we drop this check to simplify the code We optimisation itself provided an interesting speedup, so we will likely reintroduce something similar, with a dedicated flag, in the future. Differential Revision: https://phab.mercurial-scm.org/D9116
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 25 Sep 2020 14:54:43 +0200
parents 4f876e6b30fa
children 2693659c2b34
files mercurial/copies.py
diffstat 1 files changed, 17 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Fri Sep 25 14:52:34 2020 +0200
+++ b/mercurial/copies.py	Fri Sep 25 14:54:43 2020 +0200
@@ -13,8 +13,6 @@
 from .i18n import _
 
 
-from .revlogutils.flagutil import REVIDX_SIDEDATA
-
 from . import (
     match as matchmod,
     node,
@@ -202,7 +200,6 @@
         return ismerged
 
     changelogrevision = cl.changelogrevision
-    flags = cl.flags
 
     # A small cache to avoid doing the work twice for merges
     #
@@ -232,28 +229,23 @@
     def revinfo(rev):
         p1, p2 = parents(rev)
         value = None
-        if flags(rev) & REVIDX_SIDEDATA:
-            e = merge_caches.pop(rev, None)
-            if e is not None:
-                return e
-            c = changelogrevision(rev)
-            p1copies = c.p1copies
-            p2copies = c.p2copies
-            removed = c.filesremoved
-            if p1 != node.nullrev and p2 != node.nullrev:
-                # XXX some case we over cache, IGNORE
-                value = merge_caches[rev] = (
-                    p1,
-                    p2,
-                    p1copies,
-                    p2copies,
-                    removed,
-                    get_ismerged(rev),
-                )
-        else:
-            p1copies = {}
-            p2copies = {}
-            removed = []
+        e = merge_caches.pop(rev, None)
+        if e is not None:
+            return e
+        c = changelogrevision(rev)
+        p1copies = c.p1copies
+        p2copies = c.p2copies
+        removed = c.filesremoved
+        if p1 != node.nullrev and p2 != node.nullrev:
+            # XXX some case we over cache, IGNORE
+            value = merge_caches[rev] = (
+                p1,
+                p2,
+                p1copies,
+                p2copies,
+                removed,
+                get_ismerged(rev),
+            )
 
         if value is None:
             value = (p1, p2, p1copies, p2copies, removed, get_ismerged(rev))