sidedata: simply read p2copies files from the `ChangingFiles` object
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 23 Sep 2020 15:16:35 +0200
changeset 45575 147fb889278b
parent 45574 4e2238ba51a4
child 45576 c1b603cdc95a
sidedata: simply read p2copies files from the `ChangingFiles` object
mercurial/changelog.py
--- a/mercurial/changelog.py	Wed Sep 23 15:16:16 2020 +0200
+++ b/mercurial/changelog.py	Wed Sep 23 15:16:35 2020 +0200
@@ -27,8 +27,6 @@
     stringutil,
 )
 
-from .revlogutils import sidedata as sidedatamod
-
 _defaultextra = {b'branch': b'default'}
 
 
@@ -360,9 +358,7 @@
     @property
     def p2copies(self):
         if self._cpsd:
-            rawcopies = self._sidedata.get(sidedatamod.SD_P2COPIES)
-            if not rawcopies:
-                return {}
+            return self.changes.copied_from_p2
         else:
             rawcopies = self.extra.get(b'p2copies')
         if rawcopies is None: