# HG changeset patch # User Martin von Zweigbergk # Date 1494631881 25200 # Node ID 77dac8fd30eedbcc06da3bb404bfeb923d6ddd4f # Parent 0aa4032a97e184f49a53172e1531455546f7cccf match: avoid accessing match._pathrestricted from subdirmatcher Accessing only the public API wherever possible helps us refactor matchers later. diff -r 0aa4032a97e1 -r 77dac8fd30ee mercurial/match.py --- a/mercurial/match.py Thu May 18 10:17:57 2017 -0700 +++ b/mercurial/match.py Fri May 12 16:31:21 2017 -0700 @@ -381,7 +381,6 @@ self._path = path self._matcher = matcher self._always = matcher._always - self._pathrestricted = matcher._pathrestricted self._files = [f[len(path) + 1:] for f in matcher._files if f.startswith(path + "/")] @@ -398,15 +397,18 @@ # call the original matcher with the subdirectory path prepended. self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn) + def bad(self, f, msg): + self._matcher.bad(self._path + "/" + f, msg) + def abs(self, f): return self._matcher.abs(self._path + "/" + f) - def bad(self, f, msg): - self._matcher.bad(self._path + "/" + f, msg) - def rel(self, f): return self._matcher.rel(self._path + "/" + f) + def uipath(self, f): + return self._matcher.uipath(self._path + "/" + f) + def visitdir(self, dir): if dir == '.': dir = self._path