Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 37140:db90a5793103
localrepo: make filterpats private (API)
I'm not sure why this is available on the public API. AFAICT it isn't
used outside of the class.
.. api::
localrepo.localrepository.filterpats was renamed to
localrepo.localrepository._filterpats.
Differential Revision: https://phab.mercurial-scm.org/D2927
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 20 Mar 2018 18:02:16 -0700 |
parents | ecac0006b90e |
children | daef13da66fe |
comparison
equal
deleted
inserted
replaced
37139:e2d386b8a38f | 37140:db90a5793103 |
---|---|
493 | 493 |
494 self._dirstatevalidatewarned = False | 494 self._dirstatevalidatewarned = False |
495 | 495 |
496 self._branchcaches = {} | 496 self._branchcaches = {} |
497 self._revbranchcache = None | 497 self._revbranchcache = None |
498 self.filterpats = {} | 498 self._filterpats = {} |
499 self._datafilters = {} | 499 self._datafilters = {} |
500 self._transref = self._lockref = self._wlockref = None | 500 self._transref = self._lockref = self._wlockref = None |
501 | 501 |
502 # A cache for various files under .hg/ that tracks file changes, | 502 # A cache for various files under .hg/ that tracks file changes, |
503 # (used by the filecache decorator) | 503 # (used by the filecache decorator) |
1096 | 1096 |
1097 def pathto(self, f, cwd=None): | 1097 def pathto(self, f, cwd=None): |
1098 return self.dirstate.pathto(f, cwd) | 1098 return self.dirstate.pathto(f, cwd) |
1099 | 1099 |
1100 def _loadfilter(self, filter): | 1100 def _loadfilter(self, filter): |
1101 if filter not in self.filterpats: | 1101 if filter not in self._filterpats: |
1102 l = [] | 1102 l = [] |
1103 for pat, cmd in self.ui.configitems(filter): | 1103 for pat, cmd in self.ui.configitems(filter): |
1104 if cmd == '!': | 1104 if cmd == '!': |
1105 continue | 1105 continue |
1106 mf = matchmod.match(self.root, '', [pat]) | 1106 mf = matchmod.match(self.root, '', [pat]) |
1116 # Wrap old filters not supporting keyword arguments | 1116 # Wrap old filters not supporting keyword arguments |
1117 if not pycompat.getargspec(fn)[2]: | 1117 if not pycompat.getargspec(fn)[2]: |
1118 oldfn = fn | 1118 oldfn = fn |
1119 fn = lambda s, c, **kwargs: oldfn(s, c) | 1119 fn = lambda s, c, **kwargs: oldfn(s, c) |
1120 l.append((mf, fn, params)) | 1120 l.append((mf, fn, params)) |
1121 self.filterpats[filter] = l | 1121 self._filterpats[filter] = l |
1122 return self.filterpats[filter] | 1122 return self._filterpats[filter] |
1123 | 1123 |
1124 def _filter(self, filterpats, filename, data): | 1124 def _filter(self, filterpats, filename, data): |
1125 for mf, fn, cmd in filterpats: | 1125 for mf, fn, cmd in filterpats: |
1126 if mf(filename): | 1126 if mf(filename): |
1127 self.ui.debug("filtering %s through %s\n" % (filename, cmd)) | 1127 self.ui.debug("filtering %s through %s\n" % (filename, cmd)) |