IDEA-77303 File copying : "Overwriting" removes the file without creating new one

Files for deletion are stored in myDeletedFiles with system dependent paths.
(cherry picked from commit 178e08c)
This commit is contained in:
Kirill Likhodedov
2012-03-30 16:15:36 +04:00
parent 030279297c
commit abe770805f
@@ -23,6 +23,7 @@ import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.actions.VcsContextFactory;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
@@ -444,12 +445,12 @@ public abstract class VcsVFSListener implements Disposable {
}
for (Iterator<FilePath> iter = myDeletedFiles.iterator(); iter.hasNext(); ) {
if (copiedAddedMoved.contains(iter.next().getPath())) {
if (copiedAddedMoved.contains(FileUtil.toSystemIndependentName(iter.next().getPath()))) {
iter.remove();
}
}
for (Iterator<FilePath> iter = myDeletedWithoutConfirmFiles.iterator(); iter.hasNext(); ) {
if (copiedAddedMoved.contains(iter.next().getPath())) {
if (copiedAddedMoved.contains(FileUtil.toSystemIndependentName(iter.next().getPath()))) {
iter.remove();
}
}