mercurial/util.py
changeset 4190 e8ee8fdeddb1
parent 4188 dd0d9bd91e0a
child 4192 492d0d5b6976
equal deleted inserted replaced
4189:8e947b0e53cc 4190:e8ee8fdeddb1
   380 
   380 
   381 def matcher(canonroot, cwd='', names=[], inc=[], exc=[], head='', src=None):
   381 def matcher(canonroot, cwd='', names=[], inc=[], exc=[], head='', src=None):
   382     return _matcher(canonroot, cwd, names, inc, exc, head, 'glob', src)
   382     return _matcher(canonroot, cwd, names, inc, exc, head, 'glob', src)
   383 
   383 
   384 def cmdmatcher(canonroot, cwd='', names=[], inc=[], exc=[], head='',
   384 def cmdmatcher(canonroot, cwd='', names=[], inc=[], exc=[], head='',
   385                src=None, globbed=False):
   385                src=None, globbed=False, default=None):
   386     if not globbed:
   386     default = default or 'relpath'
       
   387     if default == 'relpath' and not globbed:
   387         names = expand_glob(names)
   388         names = expand_glob(names)
   388     return _matcher(canonroot, cwd, names, inc, exc, head, 'relpath', src)
   389     return _matcher(canonroot, cwd, names, inc, exc, head, default, src)
   389 
   390 
   390 def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat, src):
   391 def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat, src):
   391     """build a function to match a set of file patterns
   392     """build a function to match a set of file patterns
   392 
   393 
   393     arguments:
   394     arguments: