changeset 32324:77dac8fd30ee

match: avoid accessing match._pathrestricted from subdirmatcher Accessing only the public API wherever possible helps us refactor matchers later.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 12 May 2017 16:31:21 -0700
parents 0aa4032a97e1
children 763d72925691
files mercurial/match.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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