Mercurial > public > mercurial-scm > hg
diff mercurial/changelog.py @ 43146:0171483b082f
sidedatacopies: read rename information from sidedata
Repository using the new format now use changeset centric algorithm and read the
copies information from the changelog sidedata.
Differential Revision: https://phab.mercurial-scm.org/D6953
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 09 Oct 2019 22:59:38 +0200 |
parents | 4296cc3c4ae1 |
children | 54e943b28101 |
line wrap: on
line diff
--- a/mercurial/changelog.py Thu Oct 10 00:06:41 2019 +0200 +++ b/mercurial/changelog.py Wed Oct 09 22:59:38 2019 +0200 @@ -362,28 +362,40 @@ @property def filesadded(self): - rawindices = self.extra.get(b'filesadded') + if sidedatamod.SD_FILESADDED in self._sidedata: + rawindices = self._sidedata.get(sidedatamod.SD_FILESADDED) + else: + rawindices = self.extra.get(b'filesadded') if rawindices is None: return None return decodefileindices(self.files, rawindices) @property def filesremoved(self): - rawindices = self.extra.get(b'filesremoved') + if sidedatamod.SD_FILESREMOVED in self._sidedata: + rawindices = self._sidedata.get(sidedatamod.SD_FILESREMOVED) + else: + rawindices = self.extra.get(b'filesremoved') if rawindices is None: return None return decodefileindices(self.files, rawindices) @property def p1copies(self): - rawcopies = self.extra.get(b'p1copies') + if sidedatamod.SD_P1COPIES in self._sidedata: + rawcopies = self._sidedata.get(sidedatamod.SD_P1COPIES) + else: + rawcopies = self.extra.get(b'p1copies') if rawcopies is None: return None return decodecopies(self.files, rawcopies) @property def p2copies(self): - rawcopies = self.extra.get(b'p2copies') + if sidedatamod.SD_P2COPIES in self._sidedata: + rawcopies = self._sidedata.get(sidedatamod.SD_P2COPIES) + else: + rawcopies = self.extra.get(b'p2copies') if rawcopies is None: return None return decodecopies(self.files, rawcopies)