changeset 23776:70bf92b87410

status: cache dirstate status in _dirstatestatus() Since it's only the dirstate status we cache, it makes more sense to cache it in the _dirstatestatus() method. Note that this change means the dirstate status will also be cached when status is requested between the working copy and some other revision, while we currently only cache the result if exactly the status between the working copy and its parent is requested.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 08 Jan 2015 13:12:44 -0800
parents 885c0290f7d5
children a4951adebfb0
files mercurial/context.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Thu Oct 16 21:49:28 2014 -0700
+++ b/mercurial/context.py	Thu Jan 08 13:12:44 2015 -0800
@@ -1495,6 +1495,15 @@
             if fixup and listclean:
                 s.clean.extend(fixup)
 
+        if match.always():
+            # cache for performance
+            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 _buildstatus(self, other, s, match, listignored, listclean,
@@ -1515,14 +1524,6 @@
             s = super(workingctx, self)._buildstatus(other, s, match,
                                                      listignored, listclean,
                                                      listunknown)
-        elif match.always():
-            # cache for performance
-            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):