Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 41687:0531dff73d0b
match: delete unused root and cwd arguments from {always,never,exact}() (API)
Differential Revision: https://phab.mercurial-scm.org/D5930
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 09 Feb 2019 22:50:53 -0800 |
parents | ddbebce94665 |
children | ec7bba81ebf4 |
comparison
equal
deleted
inserted
replaced
41686:ddbebce94665 | 41687:0531dff73d0b |
---|---|
1225 return narrowspec.load(self) | 1225 return narrowspec.load(self) |
1226 | 1226 |
1227 @storecache(narrowspec.FILENAME) | 1227 @storecache(narrowspec.FILENAME) |
1228 def _storenarrowmatch(self): | 1228 def _storenarrowmatch(self): |
1229 if repository.NARROW_REQUIREMENT not in self.requirements: | 1229 if repository.NARROW_REQUIREMENT not in self.requirements: |
1230 return matchmod.always(self.root, '') | 1230 return matchmod.always() |
1231 include, exclude = self.narrowpats | 1231 include, exclude = self.narrowpats |
1232 return narrowspec.match(self.root, include=include, exclude=exclude) | 1232 return narrowspec.match(self.root, include=include, exclude=exclude) |
1233 | 1233 |
1234 @storecache(narrowspec.FILENAME) | 1234 @storecache(narrowspec.FILENAME) |
1235 def _narrowmatch(self): | 1235 def _narrowmatch(self): |
1236 if repository.NARROW_REQUIREMENT not in self.requirements: | 1236 if repository.NARROW_REQUIREMENT not in self.requirements: |
1237 return matchmod.always(self.root, '') | 1237 return matchmod.always() |
1238 narrowspec.checkworkingcopynarrowspec(self) | 1238 narrowspec.checkworkingcopynarrowspec(self) |
1239 include, exclude = self.narrowpats | 1239 include, exclude = self.narrowpats |
1240 return narrowspec.match(self.root, include=include, exclude=exclude) | 1240 return narrowspec.match(self.root, include=include, exclude=exclude) |
1241 | 1241 |
1242 def narrowmatch(self, match=None, includeexact=False): | 1242 def narrowmatch(self, match=None, includeexact=False): |
1250 """ | 1250 """ |
1251 if match: | 1251 if match: |
1252 if includeexact and not self._narrowmatch.always(): | 1252 if includeexact and not self._narrowmatch.always(): |
1253 # do not exclude explicitly-specified paths so that they can | 1253 # do not exclude explicitly-specified paths so that they can |
1254 # be warned later on | 1254 # be warned later on |
1255 em = matchmod.exact(None, None, match.files()) | 1255 em = matchmod.exact(match.files()) |
1256 nm = matchmod.unionmatcher([self._narrowmatch, em]) | 1256 nm = matchmod.unionmatcher([self._narrowmatch, em]) |
1257 return matchmod.intersectmatchers(match, nm) | 1257 return matchmod.intersectmatchers(match, nm) |
1258 return matchmod.intersectmatchers(match, self._narrowmatch) | 1258 return matchmod.intersectmatchers(match, self._narrowmatch) |
1259 return self._narrowmatch | 1259 return self._narrowmatch |
1260 | 1260 |
2398 | 2398 |
2399 def fail(f, msg): | 2399 def fail(f, msg): |
2400 raise error.Abort('%s: %s' % (f, msg)) | 2400 raise error.Abort('%s: %s' % (f, msg)) |
2401 | 2401 |
2402 if not match: | 2402 if not match: |
2403 match = matchmod.always(self.root, '') | 2403 match = matchmod.always() |
2404 | 2404 |
2405 if not force: | 2405 if not force: |
2406 vdirs = [] | 2406 vdirs = [] |
2407 match.explicitdir = vdirs.append | 2407 match.explicitdir = vdirs.append |
2408 match.bad = fail | 2408 match.bad = fail |