File (@NotNull final VirtualFile file, @NotNull final VirtualFile toDir, @NotNull final String copyName) { if (!isMyVcs(toDir)) return null; startOperation(toDir); File srcFile = virtualToIoFile(file); File destFile = new File(virtualToIoFile(toDir), copyName); if (!SvnUtil.isSvnVersioned(myVcs, destFile.getParentFile()) && !isPendingAdd(toDir)) { return null; } if (!SvnUtil.isSvnVersioned(myVcs, srcFile.getParentFile())) { myAddedFiles.add(new AddedFileInfo(toDir, copyName, null, false)); return null; } final Status fileStatus = getFileStatus(srcFile); if (fileStatus != null && fileStatus.is(StatusType.STATUS_ADDED)) { myAddedFiles.add(new AddedFileInfo(toDir, copyName, null, false)); return null; } if (sameRoot(file.getParent(), toDir)) { myAddedFiles.add(new AddedFileInfo(toDir, copyName, srcFile, false)); return null; } myAddedFiles.add(new AddedFileInfo(toDir, copyName, null, false)); return null; }