mercurial/cmdutil.py
branchstable
changeset 16542 e596a631210e
parent 16458 55982f62651f
child 16551 ebf6d38c9063
--- a/mercurial/cmdutil.py	Sat Apr 28 02:00:04 2012 +0200
+++ b/mercurial/cmdutil.py	Sat Apr 28 20:29:21 2012 +0200
@@ -268,6 +268,11 @@
     # otarget: ossep
     def copyfile(abssrc, relsrc, otarget, exact):
         abstarget = scmutil.canonpath(repo.root, cwd, otarget)
+        if '/' in abstarget:
+            # We cannot normalize abstarget itself, this would prevent
+            # case only renames, like a => A.
+            abspath, absname = abstarget.rsplit('/', 1)
+            abstarget = repo.dirstate.normalize(abspath) + '/' + absname
         reltarget = repo.pathto(abstarget, cwd)
         target = repo.wjoin(abstarget)
         src = repo.wjoin(abssrc)