# HG changeset patch # User Alexis S. L. Carvalho # Date 1173578446 10800 # Node ID 08d31e43592a26bef2150566a2669f84f5bd77b0 # Parent 51ee2868a57177e161a612da1db5398016af6a2a Leave normalization of patterns to util._matcher Passing [] to util.cmdmatcher accidentally fixes walking of files with "\n" in the name. diff -r 51ee2868a571 -r 08d31e43592a mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Mar 10 23:00:45 2007 -0300 +++ b/mercurial/cmdutil.py Sat Mar 10 23:00:46 2007 -0300 @@ -129,13 +129,7 @@ def matchpats(repo, pats=[], opts={}, head='', globbed=False): cwd = repo.getcwd() - if not pats and cwd: - opts['include'] = [os.path.join(cwd, i) - for i in opts.get('include', [])] - opts['exclude'] = [os.path.join(cwd, x) - for x in opts.get('exclude', [])] - cwd = '' - return util.cmdmatcher(repo.root, cwd, pats or ['.'], opts.get('include'), + return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'), opts.get('exclude'), head, globbed=globbed) def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None, diff -r 51ee2868a571 -r 08d31e43592a tests/test-issue352 --- a/tests/test-issue352 Sat Mar 10 23:00:45 2007 -0300 +++ b/tests/test-issue352 Sat Mar 10 23:00:46 2007 -0300 @@ -6,16 +6,17 @@ A=`echo -e -n 'he\rllo'` -echo foo > "hell -o" echo foo > "$A" hg add hg ci -A -m m rm "$A" -ls + +echo foo > "hell +o" hg add -# BUG ? we don't walk on filenames with '\n' (regexp related) ? -hg debugwalk hg ci -A -m m +echo foo > "$A" +hg debugwalk + exit 0 diff -r 51ee2868a571 -r 08d31e43592a tests/test-issue352.out --- a/tests/test-issue352.out Sat Mar 10 23:00:45 2007 -0300 +++ b/tests/test-issue352.out Sat Mar 10 23:00:46 2007 -0300 @@ -2,6 +2,13 @@ abort: '\n' and '\r' disallowed in filenames adding he llo abort: '\n' and '\r' disallowed in filenames -hell +adding hell +o +abort: '\n' and '\r' disallowed in filenames +adding hell o -nothing changed +abort: '\n' and '\r' disallowed in filenames +f he llo he llo +f hell +o hell +o