mercurial/scmutil.py
changeset 16171 336e61875335
parent 16167 94a8396c9305
child 16208 85db991780b7
equal deleted inserted replaced
16170:ef2373ea3d24 16171:336e61875335
   577                 ret.extend(globbed)
   577                 ret.extend(globbed)
   578                 continue
   578                 continue
   579         ret.append(p)
   579         ret.append(p)
   580     return ret
   580     return ret
   581 
   581 
   582 def match(ctx, pats=[], opts={}, globbed=False, default='relpath'):
   582 def matchandpats(ctx, pats=[], opts={}, globbed=False, default='relpath'):
   583     if pats == ("",):
   583     if pats == ("",):
   584         pats = []
   584         pats = []
   585     if not globbed and default == 'relpath':
   585     if not globbed and default == 'relpath':
   586         pats = expandpats(pats or [])
   586         pats = expandpats(pats or [])
   587 
   587 
   588     m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
   588     m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
   589                          default)
   589                          default)
   590     def badfn(f, msg):
   590     def badfn(f, msg):
   591         ctx._repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
   591         ctx._repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
   592     m.bad = badfn
   592     m.bad = badfn
   593     return m
   593     return m, pats
       
   594 
       
   595 def match(ctx, pats=[], opts={}, globbed=False, default='relpath'):
       
   596     return matchandpats(ctx, pats, opts, globbed, default)[0]
   594 
   597 
   595 def matchall(repo):
   598 def matchall(repo):
   596     return matchmod.always(repo.root, repo.getcwd())
   599     return matchmod.always(repo.root, repo.getcwd())
   597 
   600 
   598 def matchfiles(repo, files):
   601 def matchfiles(repo, files):