mercurial/util.py
changeset 4237 da6b14877195
parent 4232 0d51eb296fb9
parent 4236 34c4540c04c5
child 4256 fe0fe0b4d73b
equal deleted inserted replaced
4232:0d51eb296fb9 4237:da6b14877195
   494             root.append(p)
   494             root.append(p)
   495         return '/'.join(root) or '.'
   495         return '/'.join(root) or '.'
   496 
   496 
   497     def normalizepats(names, default):
   497     def normalizepats(names, default):
   498         pats = []
   498         pats = []
   499         files = []
       
   500         roots = []
   499         roots = []
   501         anypats = False
   500         anypats = False
   502         for kind, name in [patkind(p, default) for p in names]:
   501         for kind, name in [patkind(p, default) for p in names]:
   503             if kind in ('glob', 'relpath'):
   502             if kind in ('glob', 'relpath'):
   504                 name = canonpath(canonroot, cwd, name)
   503                 name = canonpath(canonroot, cwd, name)
   505             elif kind in ('relglob', 'path'):
   504             elif kind in ('relglob', 'path'):
   506                 name = normpath(name)
   505                 name = normpath(name)
       
   506 
       
   507             pats.append((kind, name))
       
   508 
   507             if kind in ('glob', 're', 'relglob', 'relre'):
   509             if kind in ('glob', 're', 'relglob', 'relre'):
   508                 pats.append((kind, name))
       
   509                 anypats = True
   510                 anypats = True
       
   511 
   510             if kind == 'glob':
   512             if kind == 'glob':
   511                 root = globprefix(name)
   513                 root = globprefix(name)
   512                 roots.append(root)
   514                 roots.append(root)
   513             elif kind in ('relpath', 'path'):
   515             elif kind in ('relpath', 'path'):
   514                 files.append((kind, name))
   516                 roots.append(name or '.')
   515                 roots.append(name)
       
   516             elif kind == 'relglob':
   517             elif kind == 'relglob':
   517                 roots.append('.')
   518                 roots.append('.')
   518         return roots, pats + files, anypats
   519         return roots, pats, anypats
   519 
   520 
   520     roots, pats, anypats = normalizepats(names, dflt_pat)
   521     roots, pats, anypats = normalizepats(names, dflt_pat)
   521 
   522 
   522     patmatch = matchfn(pats, '$') or always
   523     patmatch = matchfn(pats, '$') or always
   523     incmatch = always
   524     incmatch = always