D6953: sidedatacopies: read rename information from sidedata
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Oct 9 18:34:22 UTC 2019
marmoute added inline comments.
INLINE COMMENTS
> martinvonz wrote in context.py:536-550
> What do you think about writing this as follows? That reduces some of the `if filesremoved is None: filesremoved = []` duplication.
>
> filesadded = self._changeset.filesadded
> if self._repo.filecopiesmode != b'changeset-sidedata':
> source = self._repo.ui.config(b'experimental', b'copies.read-from')
> if source == b'compatibility':
> if filesadded is None:
> filesadded = copies.computechangesetfilesadded(self)
> elif source != b'changeset-only':
> filesadded = copies.computechangesetfilesadded(self)
> if filesadded is None:
> filesadded = []
> return filesadded
>
> Analogous changes can be made to `filesremoved()` and `p[12]copies()`.
I think I prefer my version for being a bit more explicite (all `if`s are positive) and hence easier to read for people new to this code. However, I don't mind your version if you really want it that way. Just let me know.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6953/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6953
To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel
mailing list