mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: IDEA-153272 Don't discriminate unversioned and ignored files
When a file is moved and overwrites existing file (with the same name), at first it is deleted in the new place. This deletion would schedule a `git rm` operation, however there is a logic which prevents from these files to be deleted in the case of overwrite. However this logic was not enabled for unversioned and ignored files. filterOutUnknownFiles() is not needed anymore since unknown files are not filtered in all cases.
This commit is contained in:
@@ -21,7 +21,6 @@ import com.intellij.openapi.command.CommandAdapter;
|
|||||||
import com.intellij.openapi.command.CommandEvent;
|
import com.intellij.openapi.command.CommandEvent;
|
||||||
import com.intellij.openapi.command.CommandProcessor;
|
import com.intellij.openapi.command.CommandProcessor;
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.util.Comparing;
|
import com.intellij.openapi.util.Comparing;
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
@@ -267,10 +266,6 @@ public abstract class VcsVFSListener implements Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean filterOutUnknownFiles() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void processMovedFile(VirtualFile file, String newParentPath, String newName) {
|
protected void processMovedFile(VirtualFile file, String newParentPath, String newName) {
|
||||||
final FileStatus status = FileStatusManager.getInstance(myProject).getStatus(file);
|
final FileStatus status = FileStatusManager.getInstance(myProject).getStatus(file);
|
||||||
LOG.debug("Checking moved file " + file + "; status=" + status);
|
LOG.debug("Checking moved file " + file + "; status=" + status);
|
||||||
@@ -280,21 +275,19 @@ public abstract class VcsVFSListener implements Disposable {
|
|||||||
myDirtyFiles.add(file); // will be at new path
|
myDirtyFiles.add(file); // will be at new path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(filterOutUnknownFiles() && status == FileStatus.UNKNOWN) && status != FileStatus.IGNORED) {
|
final String newPath = newParentPath + "/" + newName;
|
||||||
final String newPath = newParentPath + "/" + newName;
|
boolean foundExistingInfo = false;
|
||||||
boolean foundExistingInfo = false;
|
for (MovedFileInfo info : myMovedFiles) {
|
||||||
for (MovedFileInfo info : myMovedFiles) {
|
if (Comparing.equal(info.myFile, file)) {
|
||||||
if (Comparing.equal(info.myFile, file)) {
|
info.myNewPath = newPath;
|
||||||
info.myNewPath = newPath;
|
foundExistingInfo = true;
|
||||||
foundExistingInfo = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!foundExistingInfo) {
|
|
||||||
LOG.debug("Registered moved file " + file);
|
|
||||||
myMovedFiles.add(new MovedFileInfo(file, newPath));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!foundExistingInfo) {
|
||||||
|
LOG.debug("Registered moved file " + file);
|
||||||
|
myMovedFiles.add(new MovedFileInfo(file, newPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeMoveRename() {
|
private void executeMoveRename() {
|
||||||
|
|||||||
Reference in New Issue
Block a user