changeset 33242:9f781f43f2ce

match: make basematcher._files a @propertycache This will make it easier to override in subclasses (otherwise the function @propertycache object will be replaced by the super-constructor call)..
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 19 May 2017 10:17:08 -0700
parents a04bc55201c3
children f9445b528687
files mercurial/match.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -209,7 +209,6 @@
         self._cwd = cwd
         if badfn is not None:
             self.bad = badfn
-        self._files = [] # exact files and roots of patterns
         self.matchfn = lambda f: False
 
     def __call__(self, fn):
@@ -247,6 +246,10 @@
         Otherwise it is relative to the root of the repo.'''
         return self.rel(f)
 
+    @propertycache
+    def _files(self):
+        return []
+
     def files(self):
         '''Explicitly listed files or patterns or roots:
         if no patterns or .always(): empty list,