comparison mercurial/context.py @ 33955:e43264525ce5

context: remove unnecessary default values for matchers (API) ctx._dirstatestatus() is called only from workingctx._buildstatus() and that function, in turn, is called only from basectx.status(). basectx.status() will always pass a matcher to _buildstatus(), so there's no need to handle a None matcher there. Differential Revision: https://phab.mercurial-scm.org/D492
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 22 Aug 2017 23:39:05 -0700
parents c714e82b9ac2
children becce02036e1
comparison
equal deleted inserted replaced
33954:c714e82b9ac2 33955:e43264525ce5
1748 pass 1748 pass
1749 finally: 1749 finally:
1750 # Even if the wlock couldn't be grabbed, clear out the list. 1750 # Even if the wlock couldn't be grabbed, clear out the list.
1751 self._repo.clearpostdsstatus() 1751 self._repo.clearpostdsstatus()
1752 1752
1753 def _dirstatestatus(self, match=None, ignored=False, clean=False, 1753 def _dirstatestatus(self, match, ignored=False, clean=False, unknown=False):
1754 unknown=False):
1755 '''Gets the status from the dirstate -- internal use only.''' 1754 '''Gets the status from the dirstate -- internal use only.'''
1756 listignored, listclean, listunknown = ignored, clean, unknown 1755 listignored, listclean, listunknown = ignored, clean, unknown
1757 match = match or matchmod.always(self._repo.root, self._repo.getcwd())
1758 subrepos = [] 1756 subrepos = []
1759 if '.hgsub' in self: 1757 if '.hgsub' in self:
1760 subrepos = sorted(self.substate) 1758 subrepos = sorted(self.substate)
1761 cmp, s = self._repo.dirstate.status(match, subrepos, listignored, 1759 cmp, s = self._repo.dirstate.status(match, subrepos, listignored,
1762 listclean, listunknown) 1760 listclean, listunknown)
1978 def __init__(self, repo, changes, 1976 def __init__(self, repo, changes,
1979 text="", user=None, date=None, extra=None): 1977 text="", user=None, date=None, extra=None):
1980 super(workingctx, self).__init__(repo, text, user, date, extra, 1978 super(workingctx, self).__init__(repo, text, user, date, extra,
1981 changes) 1979 changes)
1982 1980
1983 def _dirstatestatus(self, match=None, ignored=False, clean=False, 1981 def _dirstatestatus(self, match, ignored=False, clean=False, unknown=False):
1984 unknown=False):
1985 """Return matched files only in ``self._status`` 1982 """Return matched files only in ``self._status``
1986 1983
1987 Uncommitted files appear "clean" via this context, even if 1984 Uncommitted files appear "clean" via this context, even if
1988 they aren't actually so in the working directory. 1985 they aren't actually so in the working directory.
1989 """ 1986 """
1990 match = match or matchmod.always(self._repo.root, self._repo.getcwd())
1991 if clean: 1987 if clean:
1992 clean = [f for f in self._manifest if f not in self._changedset] 1988 clean = [f for f in self._manifest if f not in self._changedset]
1993 else: 1989 else:
1994 clean = [] 1990 clean = []
1995 return scmutil.status([f for f in self._status.modified if match(f)], 1991 return scmutil.status([f for f in self._status.modified if match(f)],