--- 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