diff mercurial/util.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 dd0d9bd91e0a
children 492d0d5b6976
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -382,10 +382,11 @@ def matcher(canonroot, cwd='', names=[],
     return _matcher(canonroot, cwd, names, inc, exc, head, 'glob', src)
 
 def cmdmatcher(canonroot, cwd='', names=[], inc=[], exc=[], head='',
-               src=None, globbed=False):
-    if not globbed:
+               src=None, globbed=False, default=None):
+    default = default or 'relpath'
+    if default == 'relpath' and not globbed:
         names = expand_glob(names)
-    return _matcher(canonroot, cwd, names, inc, exc, head, 'relpath', src)
+    return _matcher(canonroot, cwd, names, inc, exc, head, default, src)
 
 def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat, src):
     """build a function to match a set of file patterns