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)) |