diff mercurial/cmdutil.py @ 6575:e08e0367ba15

walk: kill util.cmdmatcher and _matcher
author Matt Mackall <mpm@selenic.com>
date Mon, 12 May 2008 11:37:07 -0500
parents 30d3d531e11a
children 69f3e9ac7c56
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon May 12 11:37:07 2008 -0500
+++ b/mercurial/cmdutil.py	Mon May 12 11:37:07 2008 -0500
@@ -223,14 +223,15 @@
                               pathname),
                 mode)
 
-def matchpats(repo, pats=[], opts={}, globbed=False, default=None):
-    cwd = repo.getcwd()
-    return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'),
-                           opts.get('exclude'), globbed=globbed,
-                           default=default)
+def matchpats(repo, pats=[], opts={}, globbed=False, default='relpath'):
+    pats = pats or []
+    if not globbed and default == 'relpath':
+        pats = util.expand_glob(pats or [])
+    return util.matcher(repo.root, repo.getcwd(), pats, opts.get('include'),
+                        opts.get('exclude'), None, default)
 
 def walk(repo, pats=[], opts={}, node=None, badmatch=None, globbed=False,
-         default=None):
+         default='relpath'):
     files, matchfn, anypats = matchpats(repo, pats, opts, globbed=globbed,
                                         default=default)
     exact = dict.fromkeys(files)