D6953: sidedatacopies: read rename information from sidedata
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Oct 9 14:40:04 EDT 2019
marmoute added inline comments.
> martinvonz wrote in changelog.py:369-371
> I thought the reason you explicitly did `if rawindices is not None` was in order to not run the next statement if `rawindices` was an empty list. But that should have no effect anyway, so I was clearly wrong about that. So why did you make the `is not None` explicit? Can you just revert it if there was no good reason for it?
I am confused, the function should return a list or None. Since rawindides are bytes, they are not eligible for returns.
I updated the code as follow:
@@ -366,9 +366,9 @@ class changelogrevision(object):
rawindices = self._sidedata.get(sidedatamod.SD_FILESADDED)
rawindices = self.extra.get(b'filesadded')
- if rawindices is not None:
- rawindices = decodefileindices(self.files, rawindices)
- return rawindices
+ if rawindices is None:
+ return None
+ return decodefileindices(self.files, rawindices)
CHANGES SINCE LAST ACTION
To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel