mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: remove unused method - AbstractVcsHelper.showDifferences
This commit is contained in:
committed by
Aleksey Pivovarov
parent
8cb0d7018f
commit
be64e12a7e
@@ -74,8 +74,6 @@ public abstract class AbstractVcsHelper {
|
||||
|
||||
public abstract void showAnnotation(FileAnnotation annotation, VirtualFile file, AbstractVcs vcs, int line);
|
||||
|
||||
public abstract void showDifferences(final VcsFileRevision cvsVersionOn, final VcsFileRevision cvsVersionOn1, final File file);
|
||||
|
||||
public abstract void showChangesListBrowser(CommittedChangeList changelist, @Nls String title);
|
||||
|
||||
public void showChangesListBrowser(CommittedChangeList changelist, @Nullable VirtualFile toSelect, @Nls String title) {
|
||||
|
||||
@@ -26,11 +26,11 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.diff.*;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
import com.intellij.openapi.fileEditor.TextEditor;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
@@ -39,7 +39,6 @@ import com.intellij.openapi.progress.impl.CoreProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -62,7 +61,6 @@ import com.intellij.openapi.vcs.versionBrowser.ChangesBrowserSettingsEditor;
|
||||
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
|
||||
import com.intellij.openapi.vcs.vfs.VcsFileSystem;
|
||||
import com.intellij.openapi.vcs.vfs.VcsVirtualFile;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
@@ -88,8 +86,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
@@ -426,47 +422,6 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
|
||||
AnnotateToggleAction.doAnnotate(editor, myProject, file, annotation, vcs);
|
||||
}
|
||||
|
||||
public void showDifferences(final VcsFileRevision version1, final VcsFileRevision version2, final File file) {
|
||||
try {
|
||||
final byte[] byteContent1 = VcsHistoryUtil.loadRevisionContent(version1);
|
||||
final byte[] byteContent2 = VcsHistoryUtil.loadRevisionContent(version2);
|
||||
|
||||
if (Comparing.equal(byteContent1, byteContent2)) {
|
||||
Messages.showInfoMessage(VcsBundle.message("message.text.versions.are.identical"), VcsBundle.message("message.title.diff"));
|
||||
}
|
||||
|
||||
final SimpleDiffRequest request = new SimpleDiffRequest(myProject, file.getAbsolutePath());
|
||||
|
||||
final FileType fileType = FileTypeManager.getInstance().getFileTypeByFileName(file.getName());
|
||||
if (fileType.isBinary()) {
|
||||
Messages.showInfoMessage(VcsBundle.message("message.text.binary.versions.differ"), VcsBundle.message("message.title.diff"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
final DiffContent content1 = getContentForVersion(version1, file);
|
||||
final DiffContent content2 = getContentForVersion(version2, file);
|
||||
|
||||
if (version2.getRevisionNumber().compareTo(version1.getRevisionNumber()) > 0) {
|
||||
request.setContents(content2, content1);
|
||||
request.setContentTitles(version2.getRevisionNumber().asString(), version1.getRevisionNumber().asString());
|
||||
}
|
||||
else {
|
||||
request.setContents(content1, content2);
|
||||
request.setContentTitles(version1.getRevisionNumber().asString(), version2.getRevisionNumber().asString());
|
||||
}
|
||||
|
||||
DiffManager.getInstance().getDiffTool().show(request);
|
||||
}
|
||||
catch (VcsException e) {
|
||||
showError(e, VcsBundle.message("message.title.diff"));
|
||||
}
|
||||
catch (IOException e) {
|
||||
showError(new VcsException(e), VcsBundle.message("message.title.diff"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showChangesBrowser(List<CommittedChangeList> changelists) {
|
||||
showChangesBrowser(changelists, null);
|
||||
}
|
||||
@@ -622,17 +577,6 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
|
||||
return fileMergeDialog.getProcessedFiles();
|
||||
}
|
||||
|
||||
private static DiffContent getContentForVersion(final VcsFileRevision version, final File file) throws IOException, VcsException {
|
||||
VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
|
||||
if (vFile != null && (version instanceof CurrentRevision) && !vFile.getFileType().isBinary()) {
|
||||
return new DocumentContent(FileDocumentManager.getInstance().getDocument(vFile), vFile.getFileType());
|
||||
}
|
||||
else {
|
||||
return new SimpleContent(VcsHistoryUtil.loadRevisionContentGuessEncoding(version, vFile, null),
|
||||
FileTypeManager.getInstance().getFileTypeByFileName(file.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
public void openCommittedChangesTab(final AbstractVcs vcs,
|
||||
final VirtualFile root,
|
||||
final ChangeBrowserSettings settings,
|
||||
|
||||
@@ -94,13 +94,6 @@ public class CvsServicesImpl extends CvsServices {
|
||||
|
||||
}
|
||||
|
||||
public void showDifferencesForFiles(CvsModule first, CvsModule second, Project project) throws Exception {
|
||||
AbstractVcsHelper.getInstance(project).showDifferences(
|
||||
createCvsVersionOn(first, project),
|
||||
createCvsVersionOn(second, project),
|
||||
new File(first.getPathInCvs()));
|
||||
}
|
||||
|
||||
public String getScrambledPasswordForPServerCvsRoot(String cvsRoot) {
|
||||
return PServerLoginProvider.getInstance()
|
||||
.getScrambledPasswordForCvsRoot(cvsRoot);
|
||||
|
||||
@@ -31,7 +31,6 @@ public abstract class CvsServices {
|
||||
boolean allowFilesSelection, String title, String selectModulePageTitle);
|
||||
|
||||
public abstract CvsRepository[] getConfiguredRepositories();
|
||||
public abstract void showDifferencesForFiles(CvsModule first, CvsModule second, Project project) throws Exception;
|
||||
public abstract String getScrambledPasswordForPServerCvsRoot(String cvsRoot);
|
||||
public abstract boolean saveRepository(CvsRepository repository);
|
||||
public abstract void openInEditor(Project project, CvsModule cvsFile);
|
||||
|
||||
@@ -80,10 +80,6 @@ class MockVcsHelper(project: Project) : AbstractVcsHelper(project) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun showDifferences(cvsVersionOn: VcsFileRevision, cvsVersionOn1: VcsFileRevision, file: File) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun showChangesListBrowser(changelist: CommittedChangeList, title: String) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
@@ -77,10 +77,6 @@ public class HgMockVcsHelper extends AbstractVcsHelper {
|
||||
public void showAnnotation(FileAnnotation annotation, VirtualFile file, AbstractVcs vcs) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showDifferences(VcsFileRevision cvsVersionOn, VcsFileRevision cvsVersionOn1, File file) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showChangesListBrowser(CommittedChangeList changelist, @Nls String title) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user