hgext/largefiles/lfutil.py
changeset 18146 819c7e10d60d
parent 18143 242d2f4ec01c
child 18147 79f2493198e1
equal deleted inserted replaced
18145:93206823bd61 18146:819c7e10d60d
   258     elif os.path.isdir(standindir):
   258     elif os.path.isdir(standindir):
   259         # no patterns: relative to repo root
   259         # no patterns: relative to repo root
   260         pats = [standindir]
   260         pats = [standindir]
   261     else:
   261     else:
   262         # no patterns and no standin dir: return matcher that matches nothing
   262         # no patterns and no standin dir: return matcher that matches nothing
   263         match = match_.match(repo.root, None, [], exact=True)
   263         return match_.match(repo.root, None, [], exact=True)
   264         match.matchfn = lambda f: False
   264 
   265         return match
   265     # no warnings about missing files or directories
   266     return getmatcher(repo, pats, opts, showbad=False)
       
   267 
       
   268 def getmatcher(repo, pats=[], opts={}, showbad=True):
       
   269     '''Wrapper around scmutil.match() that adds showbad: if false,
       
   270     neuter the match object's bad() method so it does not print any
       
   271     warnings about missing files or directories.'''
       
   272     match = scmutil.match(repo[None], pats, opts)
   266     match = scmutil.match(repo[None], pats, opts)
   273 
   267     match.bad = lambda f, msg: None
   274     if not showbad:
       
   275         match.bad = lambda f, msg: None
       
   276     return match
   268     return match
   277 
   269 
   278 def composestandinmatcher(repo, rmatcher):
   270 def composestandinmatcher(repo, rmatcher):
   279     '''Return a matcher that accepts standins corresponding to the
   271     '''Return a matcher that accepts standins corresponding to the
   280     files accepted by rmatcher. Pass the list of files in the matcher
   272     files accepted by rmatcher. Pass the list of files in the matcher