mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: @Deprecate createFilePathOnDeleted method
* it is not different from createFilePath
This commit is contained in:
@@ -183,7 +183,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
else {
|
||||
final VcsDeleteType type = needConfirmDeletion(file);
|
||||
final FilePath filePath =
|
||||
VcsContextFactory.SERVICE.getInstance().createFilePathOnDeleted(new File(file.getPath()), file.isDirectory());
|
||||
VcsContextFactory.SERVICE.getInstance().createFilePathOn(new File(file.getPath()), file.isDirectory());
|
||||
if (type == VcsDeleteType.CONFIRM) {
|
||||
myDeletedFiles.add(filePath);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.changes.LocalChangeList;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
@@ -59,8 +58,11 @@ public interface VcsContextFactory {
|
||||
* @param file the file for which the FilePath should be created.
|
||||
* @param isDirectory whether {@code file} specifies a file or a directory.
|
||||
* @return the FilePath instance.
|
||||
*
|
||||
* @deprecated use {@link #createFilePathOn(File, boolean)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
FilePath createFilePathOnDeleted(@NotNull File file, boolean isDirectory);
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,8 +298,12 @@ public class VcsUtil {
|
||||
return VcsContextFactory.SERVICE.getInstance().createFilePathOn(file, isDirectory);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #getFilePath(String, boolean)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static FilePath getFilePathForDeletedFile(@NotNull String path, boolean isDirectory) {
|
||||
return VcsContextFactory.SERVICE.getInstance().createFilePathOnDeleted(new File(path), isDirectory);
|
||||
return VcsContextFactory.SERVICE.getInstance().createFilePathOn(new File(path), isDirectory);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.intellij.openapi.vcs.changes.LocalChangeList;
|
||||
import com.intellij.openapi.vcs.changes.LocalChangeListImpl;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.NotNullFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public class RemoveLocallyFileOrDirectoryAction extends ActionOnSelectedElement
|
||||
private static List<FilePath> filesToFilePaths(final ArrayList<File> files) {
|
||||
final List<FilePath> result = new ArrayList<>();
|
||||
for(File f: files) {
|
||||
result.add(VcsContextFactory.SERVICE.getInstance().createFilePathOnDeleted(f, false));
|
||||
result.add(VcsContextFactory.SERVICE.getInstance().createFilePathOn(f, false));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class GitContentRevision implements ByteBackedContentRevision {
|
||||
boolean canBeDeleted,
|
||||
boolean unescapePath) throws VcsException {
|
||||
String absolutePath = makeAbsolutePath(vcsRoot, path, unescapePath);
|
||||
FilePath file = isDeleted ? VcsUtil.getFilePathForDeletedFile(absolutePath, false) : VcsUtil.getFilePath(absolutePath, false);
|
||||
FilePath file = VcsUtil.getFilePath(absolutePath, false);
|
||||
if (canBeDeleted && (! SystemInfo.isFileSystemCaseSensitive) && VcsFilePathUtil.caseDiffers(file.getPath(), absolutePath)) {
|
||||
// as for deleted file
|
||||
file = VcsUtil.getFilePath(absolutePath, false);
|
||||
|
||||
@@ -413,7 +413,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
realAdded.add(VcsUtil.getFilePath(rootPath + "/" + tk[1]));
|
||||
break;
|
||||
case 'D':
|
||||
realRemoved.add(VcsUtil.getFilePathForDeletedFile(rootPath + "/" + tk[1], false));
|
||||
realRemoved.add(VcsUtil.getFilePath(rootPath + "/" + tk[1], false));
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected status: " + line);
|
||||
|
||||
@@ -78,7 +78,7 @@ class GitLogRecord {
|
||||
String prefix = root.getPath() + "/";
|
||||
for (String strPath : getPaths()) {
|
||||
final String subPath = GitUtil.unescapePath(strPath);
|
||||
final FilePath revisionPath = VcsUtil.getFilePathForDeletedFile(prefix + subPath, false);
|
||||
final FilePath revisionPath = VcsUtil.getFilePath(prefix + subPath, false);
|
||||
res.add(revisionPath);
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -248,7 +248,7 @@ public class SvnChangeProvider implements ChangeProvider {
|
||||
status = null;
|
||||
}
|
||||
if (status != null && status.is(StatusType.STATUS_DELETED)) {
|
||||
final FilePath filePath = myFactory.createFilePathOnDeleted(wcPath, false);
|
||||
final FilePath filePath = myFactory.createFilePathOn(wcPath, false);
|
||||
final SvnContentRevision beforeRevision = SvnContentRevision.createBaseRevision(myVcs, filePath, status.getRevision());
|
||||
final ContentRevision afterRevision = CurrentContentRevision.create(copiedFile.getFilePath());
|
||||
context.getBuilder().processChangeInList(context.createMovedChange(beforeRevision, afterRevision, copiedStatus, status),
|
||||
|
||||
@@ -333,7 +333,7 @@ public class SvnChangeList implements CommittedChangeList, VcsRevisionNumberAwar
|
||||
final SvnFileUrlMapping urlMapping = myVcs.getSvnFileUrlMapping();
|
||||
final File file = urlMapping.getLocalPath(fullPath);
|
||||
if (file != null) {
|
||||
return VcsUtil.getFilePathForDeletedFile(file.getAbsolutePath(), isDir || file.isDirectory());
|
||||
return VcsUtil.getFilePath(file.getAbsolutePath(), isDir || file.isDirectory());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user