# HG changeset patch # User Martin von Zweigbergk # Date 1432663603 25200 # Node ID 31d543cd7062fa1fdc6b4f4c71496a7e16f0cca9 # Parent 85f1aaf18ecb97643cb0c3f844e901449c865e10 largefiles: pass in whole matcher to getstandinmatcher() The choice between the "always" case and the other case is done in getstandinmatcher() and the next patch will change how it's determined based on the matcher, so let's prepare by passing in the matcher, not just the matcher's files. diff -r 85f1aaf18ecb -r 31d543cd7062 hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py Tue May 26 09:46:48 2015 -0700 +++ b/hgext/largefiles/lfutil.py Tue May 26 11:06:43 2015 -0700 @@ -238,11 +238,11 @@ if path: link(storepath(repo, hash), path) -def getstandinmatcher(repo, pats=[]): - '''Return a match object that applies pats to the standin directory''' +def getstandinmatcher(repo, rmatcher=None): + '''Return a match object that applies rmatcher to the standin directory''' standindir = repo.wjoin(shortname) - if pats: - pats = [os.path.join(standindir, pat) for pat in pats] + if rmatcher and rmatcher.files(): + pats = [os.path.join(standindir, pat) for pat in rmatcher.files()] else: # no patterns: relative to repo root pats = [standindir] @@ -255,7 +255,7 @@ '''Return a matcher that accepts standins corresponding to the files accepted by rmatcher. Pass the list of files in the matcher as the paths specified by the user.''' - smatcher = getstandinmatcher(repo, rmatcher.files()) + smatcher = getstandinmatcher(repo, rmatcher) isstandin = smatcher.matchfn def composedmatchfn(f): return isstandin(f) and rmatcher.matchfn(splitstandin(f))