Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 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 | 50f0096a7346 |
children | a4951adebfb0 |
comparison
equal
deleted
inserted
replaced
23775:885c0290f7d5 | 23776:70bf92b87410 |
---|---|
1493 | 1493 |
1494 # update dirstate for files that are actually clean | 1494 # update dirstate for files that are actually clean |
1495 if fixup and listclean: | 1495 if fixup and listclean: |
1496 s.clean.extend(fixup) | 1496 s.clean.extend(fixup) |
1497 | 1497 |
1498 if match.always(): | |
1499 # cache for performance | |
1500 if s.unknown or s.ignored or s.clean: | |
1501 # "_status" is cached with list*=False in the normal route | |
1502 self._status = scmutil.status(s.modified, s.added, s.removed, | |
1503 s.deleted, [], [], []) | |
1504 else: | |
1505 self._status = s | |
1506 | |
1498 return s | 1507 return s |
1499 | 1508 |
1500 def _buildstatus(self, other, s, match, listignored, listclean, | 1509 def _buildstatus(self, other, s, match, listignored, listclean, |
1501 listunknown): | 1510 listunknown): |
1502 """build a status with respect to another context | 1511 """build a status with respect to another context |
1513 s.modified[:] = self._filtersuspectsymlink(s.modified) | 1522 s.modified[:] = self._filtersuspectsymlink(s.modified) |
1514 if other != self._repo['.']: | 1523 if other != self._repo['.']: |
1515 s = super(workingctx, self)._buildstatus(other, s, match, | 1524 s = super(workingctx, self)._buildstatus(other, s, match, |
1516 listignored, listclean, | 1525 listignored, listclean, |
1517 listunknown) | 1526 listunknown) |
1518 elif match.always(): | |
1519 # cache for performance | |
1520 if s.unknown or s.ignored or s.clean: | |
1521 # "_status" is cached with list*=False in the normal route | |
1522 self._status = scmutil.status(s.modified, s.added, s.removed, | |
1523 s.deleted, [], [], []) | |
1524 else: | |
1525 self._status = s | |
1526 return s | 1527 return s |
1527 | 1528 |
1528 def _matchstatus(self, other, match): | 1529 def _matchstatus(self, other, match): |
1529 """override the match method with a filter for directory patterns | 1530 """override the match method with a filter for directory patterns |
1530 | 1531 |