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