# HG changeset patch # User Matt Harbison # Date 1419190966 18000 # Node ID f1e6b86da4c0f72cae201e901065f0d99d677fa4 # Parent 444603a7ebeb746b98de3ce993783c1d74fbf481 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. diff -r 444603a7ebeb -r f1e6b86da4c0 hgext/largefiles/overrides.py --- 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,