comparison mercurial/context.py @ 40085:aa41f1b01f31

narrow: filter files by narrowspec in ctx.matches() This has no effect yet because 1) for committed changes, ctx.matches() just calls ctx.walk(), which we updated in the previous patch, and 2) for the working copy, the filtering is also done in the overridden dirstate.walk() in narrowdirstate. Differential Revision: https://phab.mercurial-scm.org/D4899
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 28 Sep 2018 22:35:05 -0700
parents 2cf18f46a1ce
children 2f47703c5489
comparison
equal deleted inserted replaced
40084:2cf18f46a1ce 40085:aa41f1b01f31
1171 return sorted(self._repo.dirstate.walk(self._repo.narrowmatch(match), 1171 return sorted(self._repo.dirstate.walk(self._repo.narrowmatch(match),
1172 subrepos=sorted(self.substate), 1172 subrepos=sorted(self.substate),
1173 unknown=True, ignored=False)) 1173 unknown=True, ignored=False))
1174 1174
1175 def matches(self, match): 1175 def matches(self, match):
1176 match = self._repo.narrowmatch(match)
1176 ds = self._repo.dirstate 1177 ds = self._repo.dirstate
1177 return sorted(f for f in ds.matches(match) if ds[f] != 'r') 1178 return sorted(f for f in ds.matches(match) if ds[f] != 'r')
1178 1179
1179 def ancestors(self): 1180 def ancestors(self):
1180 for p in self._parents: 1181 for p in self._parents: