Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/cmdutil.py @ 4181:08d31e43592a
Leave normalization of patterns to util._matcher
Passing [] to util.cmdmatcher accidentally fixes walking of files
with "\n" in the name.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 10 Mar 2007 23:00:46 -0300 |
parents | e37786b29bed |
children | e8ee8fdeddb1 |
comparison
equal
deleted
inserted
replaced
4180:51ee2868a571 | 4181:08d31e43592a |
---|---|
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): |
131 cwd = repo.getcwd() | 131 cwd = repo.getcwd() |
132 if not pats and cwd: | 132 return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'), |
133 opts['include'] = [os.path.join(cwd, i) | |
134 for i in opts.get('include', [])] | |
135 opts['exclude'] = [os.path.join(cwd, x) | |
136 for x in opts.get('exclude', [])] | |
137 cwd = '' | |
138 return util.cmdmatcher(repo.root, cwd, pats or ['.'], opts.get('include'), | |
139 opts.get('exclude'), head, globbed=globbed) | 133 opts.get('exclude'), head, globbed=globbed) |
140 | 134 |
141 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None, | 135 def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None, |
142 globbed=False): | 136 globbed=False): |
143 files, matchfn, anypats = matchpats(repo, pats, opts, head, | 137 files, matchfn, anypats = matchpats(repo, pats, opts, head, |