# HG changeset patch # User Adrian Buehlmann # Date 1302876932 -7200 # Node ID 03f3ce7ca2a86fce85eee37ef1476f411d7fae20 # Parent bc32bb0e909fd3389fdd8d253ca2966c1dad3233 copy: do not copy file if name is disallowed anyway diff -r bc32bb0e909f -r 03f3ce7ca2a8 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri Apr 15 16:15:30 2011 +0200 +++ b/mercurial/cmdutil.py Fri Apr 15 16:15:32 2011 +0200 @@ -435,6 +435,8 @@ src = repo.wjoin(abssrc) state = repo.dirstate[abstarget] + util.checkfilename(abstarget) + # check for collisions prevsrc = targets.get(abstarget) if prevsrc is not None: diff -r bc32bb0e909f -r 03f3ce7ca2a8 tests/test-eolfilename.t --- a/tests/test-eolfilename.t Fri Apr 15 16:15:30 2011 +0200 +++ b/tests/test-eolfilename.t Fri Apr 15 16:15:32 2011 +0200 @@ -36,6 +36,17 @@ o hell o + $ echo bla > quickfox + $ hg add quickfox + $ hg ci -m 2 + $ A=`printf 'quick\rfox'` + $ hg cp quickfox "$A" + abort: '\n' and '\r' disallowed in filenames: 'quick\rfox' + [255] + $ hg mv quickfox "$A" + abort: '\n' and '\r' disallowed in filenames: 'quick\rfox' + [255] + http://mercurial.selenic.com/bts/issue2036 $ cd ..