diff mercurial/cmdutil.py @ 4190:e8ee8fdeddb1

change locate to use relglobs by default This makes its default behaviour useful again (issue108), and changes it search the entire repository by default (instead of just the cwd), just like all other commands. It also hides issue204 by default, but you'll still see the same behaviour if you give it a relpath: pattern.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:00:57 -0300
parents 08d31e43592a
children 492d0d5b6976
line wrap: on
line diff
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -127,15 +127,16 @@ def make_file(repo, pat, node=None,
                               pathname),
                 mode)
 
-def matchpats(repo, pats=[], opts={}, head='', globbed=False):
+def matchpats(repo, pats=[], opts={}, head='', globbed=False, default=None):
     cwd = repo.getcwd()
     return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'),
-                           opts.get('exclude'), head, globbed=globbed)
+                           opts.get('exclude'), head, globbed=globbed,
+                           default=default)
 
 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None,
-         globbed=False):
+         globbed=False, default=None):
     files, matchfn, anypats = matchpats(repo, pats, opts, head,
-                                        globbed=globbed)
+                                        globbed=globbed, default=default)
     exact = dict.fromkeys(files)
     for src, fn in repo.walk(node=node, files=files, match=matchfn,
                              badmatch=badmatch):