mercurial/util.py
changeset 4237 da6b14877195
parent 4232 0d51eb296fb9
parent 4236 34c4540c04c5
child 4256 fe0fe0b4d73b
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -496,7 +496,6 @@ def _matcher(canonroot, cwd, names, inc,
 
     def normalizepats(names, default):
         pats = []
-        files = []
         roots = []
         anypats = False
         for kind, name in [patkind(p, default) for p in names]:
@@ -504,18 +503,20 @@ def _matcher(canonroot, cwd, names, inc,
                 name = canonpath(canonroot, cwd, name)
             elif kind in ('relglob', 'path'):
                 name = normpath(name)
+
+            pats.append((kind, name))
+
             if kind in ('glob', 're', 'relglob', 'relre'):
-                pats.append((kind, name))
                 anypats = True
+
             if kind == 'glob':
                 root = globprefix(name)
                 roots.append(root)
             elif kind in ('relpath', 'path'):
-                files.append((kind, name))
-                roots.append(name)
+                roots.append(name or '.')
             elif kind == 'relglob':
                 roots.append('.')
-        return roots, pats + files, anypats
+        return roots, pats, anypats
 
     roots, pats, anypats = normalizepats(names, dflt_pat)