mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs] inline & remove FilePathImpl#createChild + use correct separators
This commit is contained in:
@@ -21,7 +21,6 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingManager;
|
||||
@@ -43,12 +42,6 @@ public class FilePathImpl implements FilePath {
|
||||
myIsDirectory = isDirectory;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public FilePath createChild(@NotNull String subPath, boolean isDirectory) {
|
||||
if (StringUtil.isEmptyOrSpaces(subPath)) return this;
|
||||
return new FilePathImpl(myPath + File.separator + subPath, isDirectory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
+5
-5
@@ -50,6 +50,7 @@ import com.intellij.util.continuation.Continuation;
|
||||
import com.intellij.util.continuation.ContinuationContext;
|
||||
import com.intellij.util.continuation.TaskDescriptor;
|
||||
import com.intellij.util.continuation.Where;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.idea.svn.*;
|
||||
import org.jetbrains.idea.svn.api.Depth;
|
||||
@@ -58,7 +59,6 @@ import org.jetbrains.idea.svn.history.SvnChangeList;
|
||||
import org.jetbrains.idea.svn.history.SvnRepositoryLocation;
|
||||
import org.tmatesoft.svn.core.wc.SVNRevision;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@@ -490,10 +490,10 @@ public class MergeFromTheirsResolver {
|
||||
return false;
|
||||
}
|
||||
|
||||
private FilePath rebasePath(final FilePath oldBase, final FilePath newBase, final FilePath path) {
|
||||
final String relativePath = FileUtil.getRelativePath(oldBase.getPath(), path.getPath(), File.separatorChar);
|
||||
//if (StringUtil.isEmptyOrSpaces(relativePath)) return path;
|
||||
return ((FilePathImpl) newBase).createChild(relativePath, path.isDirectory());
|
||||
@NotNull
|
||||
private static FilePath rebasePath(@NotNull FilePath oldBase, @NotNull FilePath newBase, @NotNull FilePath path) {
|
||||
String relativePath = FileUtil.getRelativePath(oldBase.getPath(), path.getPath(), '/');
|
||||
return VcsUtil.getFilePath(newBase.getPath() + "/" + relativePath, path.isDirectory());
|
||||
}
|
||||
|
||||
private class PreloadChangesContentsForFile extends TaskDescriptor {
|
||||
|
||||
Reference in New Issue
Block a user