Patchwork D9116: copies: no longer change the sidedata flag

login
register
mail settings
Submitter phabricator
Date Sept. 28, 2020, 4:32 p.m.
Message ID <differential-rev-PHID-DREV-sj4ipx56pkpjmiycmr6z-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47331/
State Superseded
Headers show

Comments

phabricator - Sept. 28, 2020, 4:32 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -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))