comparison mercurial/context.py @ 42710:87c4cd89b539

changectx: extract explicit computechangesetfilesadded method from context Right now, the logic around changeset centric added files data are buried into the "changectx" code. We extract this code in a dedicated method (in the scmutil module) for clarity. This clarity will help to explicitly compute and caches these data in the future.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 12 Jun 2019 13:42:22 +0100
parents 3cffc7bbec26
children 53c07f08fea1
comparison
equal deleted inserted replaced
42707:3cffc7bbec26 42710:87c4cd89b539
457 source = self._repo.ui.config('experimental', 'copies.read-from') 457 source = self._repo.ui.config('experimental', 'copies.read-from')
458 if (source == 'changeset-only' or 458 if (source == 'changeset-only' or
459 (source == 'compatibility' and 459 (source == 'compatibility' and
460 self._changeset.filesadded is not None)): 460 self._changeset.filesadded is not None)):
461 return self._changeset.filesadded or [] 461 return self._changeset.filesadded or []
462 462 return scmutil.computechangesetfilesadded(self)
463 added = []
464 for f in self.files():
465 if not any(f in p for p in self.parents()):
466 added.append(f)
467 return added
468 def filesremoved(self): 463 def filesremoved(self):
469 source = self._repo.ui.config('experimental', 'copies.read-from') 464 source = self._repo.ui.config('experimental', 'copies.read-from')
470 if (source == 'changeset-only' or 465 if (source == 'changeset-only' or
471 (source == 'compatibility' and 466 (source == 'compatibility' and
472 self._changeset.filesremoved is not None)): 467 self._changeset.filesremoved is not None)):