comparison 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
comparison
equal deleted inserted replaced
4189:8e947b0e53cc 4190:e8ee8fdeddb1
125 return pat 125 return pat
126 return open(make_filename(repo, pat, node, total, seqno, revwidth, 126 return open(make_filename(repo, pat, node, total, seqno, revwidth,
127 pathname), 127 pathname),
128 mode) 128 mode)
129 129
130 def matchpats(repo, pats=[], opts={}, head='', globbed=False): 130 def matchpats(repo, pats=[], opts={}, head='', globbed=False, default=None):
131 cwd = repo.getcwd() 131 cwd = repo.getcwd()
132 return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'), 132 return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'),
133 opts.get('exclude'), head, globbed=globbed) 133 opts.get('exclude'), head, globbed=globbed,
134 default=default)
134 135
135 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None, 136 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None,
136 globbed=False): 137 globbed=False, default=None):
137 files, matchfn, anypats = matchpats(repo, pats, opts, head, 138 files, matchfn, anypats = matchpats(repo, pats, opts, head,
138 globbed=globbed) 139 globbed=globbed, default=default)
139 exact = dict.fromkeys(files) 140 exact = dict.fromkeys(files)
140 for src, fn in repo.walk(node=node, files=files, match=matchfn, 141 for src, fn in repo.walk(node=node, files=files, match=matchfn,
141 badmatch=badmatch): 142 badmatch=badmatch):
142 yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact 143 yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact
143 144