mercurial/cmdutil.py
changeset 4186 08d31e43592a
parent 4055 e37786b29bed
child 4195 e8ee8fdeddb1
equal deleted inserted replaced
4185:51ee2868a571 4186:08d31e43592a
   127                               pathname),
   127                               pathname),
   128                 mode)
   128                 mode)
   129 
   129 
   130 def matchpats(repo, pats=[], opts={}, head='', globbed=False):
   130 def matchpats(repo, pats=[], opts={}, head='', globbed=False):
   131     cwd = repo.getcwd()
   131     cwd = repo.getcwd()
   132     if not pats and cwd:
   132     return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'),
   133         opts['include'] = [os.path.join(cwd, i)
       
   134                            for i in opts.get('include', [])]
       
   135         opts['exclude'] = [os.path.join(cwd, x)
       
   136                            for x in opts.get('exclude', [])]
       
   137         cwd = ''
       
   138     return util.cmdmatcher(repo.root, cwd, pats or ['.'], opts.get('include'),
       
   139                            opts.get('exclude'), head, globbed=globbed)
   133                            opts.get('exclude'), head, globbed=globbed)
   140 
   134 
   141 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None,
   135 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None,
   142          globbed=False):
   136          globbed=False):
   143     files, matchfn, anypats = matchpats(repo, pats, opts, head,
   137     files, matchfn, anypats = matchpats(repo, pats, opts, head,