largefiles: introduce the 'composelargefilematcher()' method
This is a copy/paste (with the necessary tweaks) of the composenormalfilematcher
method currently on default, which does the inverse- this trims the normal files
out of the matcher. It will be used in the next patch.
--- a/hgext/largefiles/overrides.py Thu Dec 18 14:59:28 2014 -0600
+++ b/hgext/largefiles/overrides.py Sun Dec 21 14:42:46 2014 -0500
@@ -23,6 +23,18 @@
# -- Utility functions: commonly/repeatedly needed functionality ---------------
+def composelargefilematcher(match, manifest):
+ '''create a matcher that matches only the largefiles in the original
+ matcher'''
+ m = copy.copy(match)
+ lfile = lambda f: lfutil.standin(f) in manifest
+ m._files = filter(lfile, m._files)
+ m._fmap = set(m._files)
+ m._always = False
+ origmatchfn = m.matchfn
+ m.matchfn = lambda f: lfile(f) and origmatchfn(f)
+ return m
+
def installnormalfilesmatchfn(manifest):
'''installmatchfn with a matchfn that ignores all largefiles'''
def overridematch(ctx, pats=[], opts={}, globbed=False,