Patchwork [7,of,7] sidedata: simply read p2copies files from the `ChangingFiles` object

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2020, 9:51 p.m.
Message ID <d4105e6324ea685999f4.1600897916@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/47269/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 23, 2020, 9:51 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1600866995 -7200
#      Wed Sep 23 15:16:35 2020 +0200
# Node ID d4105e6324ea685999f43bca6cdef3b762dcdfae
# Parent  f45af93514600eb77c55d6f924334871ac1117ae
# EXP-Topic new-metadata-pre
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r d4105e6324ea
sidedata: simply read p2copies files from the `ChangingFiles` object

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -27,8 +27,6 @@  from .utils import (
     stringutil,
 )
 
-from .revlogutils import sidedata as sidedatamod
-
 _defaultextra = {b'branch': b'default'}
 
 
@@ -360,9 +358,7 @@  class changelogrevision(object):
     @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: