diff mercurial/context.py @ 23709:33e5431684c0

context: make unknown/ignored/clean of cached status empty for equivalence Before this patch, "workingctx.status" caches the result of "dirstate.status" directly into "self._status". But "dirstate.status" is invoked with False "list*" arguments in normal "self._status" accessing route, and this makes "unknown"/"ignored"/"clean" of status empty. This may cause unexpected result of code paths internally accessing to them (accessors for external usage are already removed by previous patch). This patch makes "unknown"/"ignored"/"clean" of cached status empty for equivalence. Making them empty is executed only when at least one of "unknown", "ignored" or "clean" has files, for efficiency.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 31 Dec 2014 17:55:43 +0900
parents 28a302e9225d
children 745e3b485632
line wrap: on
line diff
--- a/mercurial/context.py	Wed Dec 31 13:48:55 2014 -0800
+++ b/mercurial/context.py	Wed Dec 31 17:55:43 2014 +0900
@@ -1505,7 +1505,12 @@
                                                      listunknown)
         elif match.always():
             # cache for performance
-            self._status = s
+            if s.unknown or s.ignored or s.clean:
+                # "_status" is cached with list*=False in the normal route
+                self._status = scmutil.status(s.modified, s.added, s.removed,
+                                              s.deleted, [], [], [])
+            else:
+                self._status = s
         return s
 
     def _matchstatus(self, other, match):