Mercurial > hg-stable
changeset 23617:f1e6b86da4c0 stable
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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 21 Dec 2014 14:42:46 -0500 |
parents | 444603a7ebeb |
children | 9dd5dfeaab4c |
files | hgext/largefiles/overrides.py |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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,