Patchwork D6932: context: clarify the various mode in the filesremoved method

login
register
mail settings
Submitter phabricator
Date Oct. 1, 2019, 5:07 p.m.
Message ID <52391c368d9b439ef313a90b5800c688@localhost.localdomain>
Download mbox | patch
Permalink /patch/41904/
State Not Applicable
Headers show

Comments

phabricator - Oct. 1, 2019, 5:07 p.m.
Closed by commit rHG15badd621825: context: clarify the various mode in the filesremoved method (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6932?vs=16729&id=16752

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6932/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6932

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: marmoute, martinvonz, durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -469,11 +469,16 @@ 
 
     def filesremoved(self):
         source = self._repo.ui.config('experimental', 'copies.read-from')
-        if (source == 'changeset-only' or
-            (source == 'compatibility' and
-             self._changeset.filesremoved is not None)):
-            return self._changeset.filesremoved or []
-        return scmutil.computechangesetfilesremoved(self)
+        filesremoved = self._changeset.filesremoved
+        if source == 'changeset-only':
+            if filesremoved is None:
+                filesremoved = []
+        elif source == 'compatibility':
+            if filesremoved is None:
+                filesremoved = scmutil.computechangesetfilesremoved(self)
+        else:
+            filesremoved = scmutil.computechangesetfilesremoved(self)
+        return filesremoved
 
     @propertycache
     def _copies(self):