diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -533,55 +533,58 @@ return sorted(modified) def filesadded(self): - source = self._repo.ui.config(b'experimental', b'copies.read-from') filesadded = self._changeset.filesadded - if source == b'changeset-only': - if filesadded is None: - filesadded = [] - elif source == b'compatibility': - if filesadded is None: + if True: + source = self._repo.ui.config(b'experimental', b'copies.read-from') + if source == b'changeset-only': + if filesadded is None: + filesadded = [] + elif source == b'compatibility': + if filesadded is None: + filesadded = scmutil.computechangesetfilesadded(self) + else: filesadded = scmutil.computechangesetfilesadded(self) - else: - filesadded = scmutil.computechangesetfilesadded(self) return filesadded def filesremoved(self): - source = self._repo.ui.config(b'experimental', b'copies.read-from') filesremoved = self._changeset.filesremoved - if source == b'changeset-only': - if filesremoved is None: - filesremoved = [] - elif source == b'compatibility': - if filesremoved is None: + if True: + source = self._repo.ui.config(b'experimental', b'copies.read-from') + if source == b'changeset-only': + if filesremoved is None: + filesremoved = [] + elif source == b'compatibility': + if filesremoved is None: + filesremoved = scmutil.computechangesetfilesremoved(self) + else: filesremoved = scmutil.computechangesetfilesremoved(self) - else: - filesremoved = scmutil.computechangesetfilesremoved(self) return filesremoved @propertycache def _copies(self): - source = self._repo.ui.config(b'experimental', b'copies.read-from') p1copies = self._changeset.p1copies p2copies = self._changeset.p2copies - # If config says to get copy metadata only from changeset, then return - # that, defaulting to {} if there was no copy metadata. - # In compatibility mode, we return copy data from the changeset if - # it was recorded there, and otherwise we fall back to getting it from - # the filelogs (below). - if source == b'changeset-only': - if p1copies is None: - p1copies = {} - if p2copies is None: - p2copies = {} - elif source == b'compatibility': - if p1copies is None: - # we are in compatiblity mode and there is not data in the - # changeset), we get the copy metadata from the filelogs. + if True: + source = self._repo.ui.config(b'experimental', b'copies.read-from') + # If config says to get copy metadata only from changeset, then + # return that, defaulting to {} if there was no copy metadata. In + # compatibility mode, we return copy data from the changeset if it + # was recorded there, and otherwise we fall back to getting it from + # the filelogs (below). + if source == b'changeset-only': + if p1copies is None: + p1copies = {} + if p2copies is None: + p2copies = {} + elif source == b'compatibility': + if p1copies is None: + # we are in compatiblity mode and there is not data in the + # changeset), we get the copy metadata from the filelogs. + p1copies, p2copies = super(changectx, self)._copies + else: + # config said to read only from filelog, we get the copy + # metadata from the filelogs. p1copies, p2copies = super(changectx, self)._copies - else: - # config said to read only from filelog, we get the copy metadata - # from the filelogs. - p1copies, p2copies = super(changectx, self)._copies return p1copies, p2copies def description(self):