diff hgext/largefiles/overrides.py @ 32362:23c9a2a71c6e

match: make _fileroots a @propertycache and rename it to _fileset The files in the set are not necesserily roots of anything. Making it a @propertycache will help towards extracting a base class for matchers.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 18 May 2017 09:04:37 -0700
parents e8569cc131d1
children 124ee239d9cb
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Wed May 17 23:54:43 2017 -0700
+++ b/hgext/largefiles/overrides.py	Thu May 18 09:04:37 2017 -0700
@@ -41,7 +41,7 @@
     m = copy.copy(match)
     lfile = lambda f: lfutil.standin(f) in manifest
     m._files = filter(lfile, m._files)
-    m._fileroots = set(m._files)
+    m._fileset = set(m._files)
     m._always = False
     origmatchfn = m.matchfn
     m.matchfn = lambda f: lfile(f) and origmatchfn(f)
@@ -56,7 +56,7 @@
     notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
             manifest or f in excluded)
     m._files = filter(notlfile, m._files)
-    m._fileroots = set(m._files)
+    m._fileset = set(m._files)
     m._always = False
     origmatchfn = m.matchfn
     m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
@@ -368,7 +368,7 @@
             elif m._files[i] not in ctx and repo.wvfs.isdir(standin):
                 m._files.append(standin)
 
-        m._fileroots = set(m._files)
+        m._fileset = set(m._files)
         m._always = False
         origmatchfn = m.matchfn
         def lfmatchfn(f):
@@ -644,7 +644,7 @@
             m = copy.copy(match)
             lfile = lambda f: lfutil.standin(f) in manifest
             m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
-            m._fileroots = set(m._files)
+            m._fileset = set(m._files)
             origmatchfn = m.matchfn
             def matchfn(f):
                 lfile = lfutil.splitstandin(f)
@@ -767,7 +767,7 @@
                 else:
                     matchfiles.append(f)
             m._files = matchfiles
-            m._fileroots = set(m._files)
+            m._fileset = set(m._files)
             origmatchfn = m.matchfn
             def matchfn(f):
                 lfile = lfutil.splitstandin(f)