D6953: sidedatacopies: read rename information from sidedata
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Oct 9 14:10:53 EDT 2019
martinvonz added inline comments.
INLINE COMMENTS
> context.py:536-550
> filesadded = self._changeset.filesadded
> - if True:
> + if self._repo.filecopiesmode == b'changeset-sidedata':
> + if filesadded is None:
> + filesadded = []
> + else:
> source = self._repo.ui.config(b'experimental', b'copies.read-from')
> if source == b'changeset-only':
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()`.
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