void (@NotNull VirtualFile file, @NotNull String newParentPath, @NotNull String newName) { FileStatus status = myChangeListManager.getStatus(file); LOG.debug("Checking moved file ", file, "; status=", status); String newPath = newParentPath + "/" + newName; withLock(PROCESSING_LOCK.writeLock(), () -> { if (!filterOutByStatus(status)) { MovedFileInfo existingMovedFile = ContainerUtil.find(myMovedFiles, info -> Comparing.equal(info.myFile, file)); if (existingMovedFile != null) { LOG.debug("Reusing existing moved file [" + file + "] with new path [" + newPath + "]"); existingMovedFile.myNewPath = newPath; } else { LOG.debug("Registered moved file ", file); myMovedFiles.add(new MovedFileInfo(file, newPath)); } } else { // If a file is moved on top of another file (overwrite), the VFS at first removes the original file, // and then performs the "clean" move. // But we don't need to handle this deletion by the VCS: it is not a real deletion, but just a trick to implement the overwrite. // This situation is already handled in doNotDeleteAddedCopiedOrMovedFiles(), but that method is called at the end of the command, // so it is not suitable for moving unversioned files: if an unversioned file is moved, it won't be recorded, // won't affect doNotDeleteAddedCopiedOrMovedFiles(), and therefore won't save the file from deletion. // Thus here goes a special handle for unversioned files overwrite-move. myDeletedFiles.remove(VcsUtil.getFilePath(newPath, file.isDirectory())); } }); }