mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[log] remove unused classes
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
package com.intellij.vcs.log;
|
||||
|
||||
import com.intellij.vcs.log.Hash;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class RebaseCommand {
|
||||
public enum RebaseCommandKind {
|
||||
PICK,
|
||||
FIXUP,
|
||||
REWORD
|
||||
}
|
||||
|
||||
private final RebaseCommandKind kind;
|
||||
private final Hash commit;
|
||||
private final String newMessage;
|
||||
|
||||
public RebaseCommand(RebaseCommandKind kind, Hash commit) {
|
||||
this(kind, commit, null);
|
||||
}
|
||||
|
||||
public RebaseCommand(RebaseCommandKind kind, Hash commit, @Nullable String newMessage) {
|
||||
this.kind = kind;
|
||||
this.commit = commit;
|
||||
this.newMessage = newMessage;
|
||||
}
|
||||
|
||||
public RebaseCommandKind getKind() {
|
||||
return kind;
|
||||
}
|
||||
|
||||
public Hash getCommit() {
|
||||
return commit;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getNewMessage() {
|
||||
return newMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return kind + " " + getCommit().toStrHash() + (newMessage == null ? "" : " " + newMessage);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import com.intellij.vcs.log.CommitParents;
|
||||
import com.intellij.vcs.log.Hash;
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.compressedlist.UpdateRequest;
|
||||
import com.intellij.vcs.log.data.rebase.FakeCommitParents;
|
||||
import com.intellij.vcs.log.graph.Graph;
|
||||
import com.intellij.vcs.log.graph.elements.Edge;
|
||||
import com.intellij.vcs.log.graph.elements.GraphElement;
|
||||
@@ -136,26 +135,6 @@ public class DataPack {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Node getFakeNodeByHash(Hash hash, boolean original) {
|
||||
hash = originalIfNeeded(hash, original);
|
||||
Graph graph = getGraphModel().getGraph();
|
||||
for (int i = 0; i < graph.getNodeRows().size(); i++) {
|
||||
Node node = graph.getCommitNodeInRow(i);
|
||||
if (node != null) {
|
||||
Hash commitHash = node.getCommitHash();
|
||||
if (FakeCommitParents.isFake(commitHash) && originalIfNeeded(commitHash, original).equals(hash)) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Hash originalIfNeeded(Hash hash, boolean original) {
|
||||
if (original) return FakeCommitParents.getOriginal(hash);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Node getCommonParent(Node a, Node b) {
|
||||
List<Node> commitDiff = getCommitsDownToCommon(a, b);
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.intellij.vcs.log.data;
|
||||
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.graph.elements.Node;
|
||||
import com.intellij.vcs.log.data.rebase.FakeCommitParents;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FakeCommitsInfo {
|
||||
|
||||
public final List<FakeCommitParents> commits;
|
||||
public final Node base;
|
||||
public final int insertAbove;
|
||||
public final VcsRef resultRef;
|
||||
public final VcsRef subjectRef;
|
||||
|
||||
public FakeCommitsInfo(List<FakeCommitParents> commits, Node base, int insertAbove, VcsRef resultRef, VcsRef subjectRef) {
|
||||
this.commits = commits;
|
||||
this.base = base;
|
||||
this.insertAbove = insertAbove;
|
||||
this.resultRef = resultRef;
|
||||
this.subjectRef = subjectRef;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.intellij.vcs.log.data.rebase;
|
||||
|
||||
import com.intellij.vcs.log.CommitParents;
|
||||
import com.intellij.vcs.log.Hash;
|
||||
import com.intellij.vcs.log.RebaseCommand;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class FakeCommitParents extends CommitParents {
|
||||
|
||||
private static final String FAKE_HASH_PREFIX = "aaaaaaaaaaaaa00000000";
|
||||
|
||||
public static boolean isFake(Hash hash) {
|
||||
return isFake(hash.toStrHash());
|
||||
}
|
||||
|
||||
public static boolean isFake(String hashStr) {
|
||||
return hashStr.startsWith(FAKE_HASH_PREFIX);
|
||||
}
|
||||
|
||||
public static Hash getOriginal(Hash hash) {
|
||||
return Hash.build(getOriginal(hash.toStrHash()));
|
||||
}
|
||||
|
||||
public static String getOriginal(String hash) {
|
||||
while (isFake(hash)) {
|
||||
hash = hash.substring(FAKE_HASH_PREFIX.length());
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static Hash fakeHash(Hash hash) {
|
||||
return Hash.build(FAKE_HASH_PREFIX + getOriginal(hash.toStrHash()));
|
||||
}
|
||||
|
||||
private final RebaseCommand command;
|
||||
private final Hash fakeHash;
|
||||
|
||||
public FakeCommitParents(@NotNull Hash parent, @NotNull RebaseCommand command) {
|
||||
super(fakeHash(command.getCommit()), Collections.singletonList(parent));
|
||||
this.command = command;
|
||||
this.fakeHash = fakeHash(command.getCommit());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RebaseCommand getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return fakeHash + " -> " + command;
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
package com.intellij.vcs.log.data.rebase;
|
||||
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.graph.elements.Node;
|
||||
import com.intellij.vcs.log.RebaseCommand;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class InteractiveRebaseBuilder {
|
||||
public static final InteractiveRebaseBuilder EMPTY = new InteractiveRebaseBuilder();
|
||||
|
||||
public void startRebase(VcsRef subjectRef, Node onto) {
|
||||
|
||||
}
|
||||
|
||||
public void startRebaseOnto(VcsRef subjectRef, Node base, List<Node> nodesToRebase) {
|
||||
|
||||
}
|
||||
|
||||
public void moveCommits(VcsRef subjectRef, Node base, InsertPosition position, List<Node> nodesToInsert) {
|
||||
|
||||
}
|
||||
|
||||
public void fixUp(VcsRef subjectRef, Node target, List<Node> nodesToFixUp) {
|
||||
|
||||
}
|
||||
|
||||
public void reword(VcsRef subjectRef, Node commitToReword, String newMessage) {
|
||||
|
||||
}
|
||||
|
||||
public List<RebaseCommand> getRebaseCommands() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public enum InsertPosition {
|
||||
ABOVE,
|
||||
BELOW
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.intellij.vcs.log.data.rebase;
|
||||
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.graph.elements.Node;
|
||||
import com.intellij.vcs.log.RebaseCommand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VcsLogActionHandler {
|
||||
VcsLogActionHandler DO_NOTHING = new VcsLogActionHandler() {
|
||||
@Override
|
||||
public void abortRebase() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void continueRebase() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cherryPick(VcsRef targetRef, List<Node> nodesToPick, Callback callback) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rebase(Node onto, VcsRef subjectRef, Callback callback) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rebaseOnto(Node onto, VcsRef subjectRef, List<Node> nodesToRebase, Callback callback) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interactiveRebase(VcsRef subjectRef, Node onto, Callback callback, List<RebaseCommand> commands) {
|
||||
}
|
||||
};
|
||||
|
||||
void abortRebase();
|
||||
|
||||
void continueRebase();
|
||||
|
||||
interface Callback {
|
||||
void disableModifications();
|
||||
void enableModifications();
|
||||
|
||||
void interactiveCommandApplied(RebaseCommand command);
|
||||
}
|
||||
|
||||
void cherryPick(VcsRef targetRef, List<Node> nodesToPick, Callback callback);
|
||||
|
||||
void rebase(Node onto, VcsRef subjectRef, Callback callback);
|
||||
void rebaseOnto(Node onto, VcsRef subjectRef, List<Node> nodesToRebase, Callback callback);
|
||||
|
||||
void interactiveRebase(VcsRef subjectRef, Node onto, Callback callback, List<RebaseCommand> commands);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.intellij.vcs.log.graph.mutable.elements;
|
||||
|
||||
import com.intellij.vcs.log.Hash;
|
||||
import com.intellij.vcs.log.RebaseCommand;
|
||||
import com.intellij.vcs.log.graph.elements.Branch;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class FakeNode extends MutableNode {
|
||||
private final RebaseCommand myCommand;
|
||||
|
||||
public FakeNode(Branch branch, Hash hash, RebaseCommand command) {
|
||||
super(branch, hash);
|
||||
myCommand = command;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RebaseCommand getCommand() {
|
||||
return myCommand;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.intellij.vcs.log.ui;
|
||||
|
||||
import com.intellij.vcs.log.graph.elements.Node;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.List;
|
||||
|
||||
public class DragDropListener {
|
||||
|
||||
public static final DragDropListener EMPTY = new DragDropListener();
|
||||
|
||||
public static class Handler {
|
||||
|
||||
private static final Handler EMPTY = new Handler();
|
||||
|
||||
public void above(int rowIndex, Node commit, MouseEvent e, List<Node> commitsBeingDragged) {
|
||||
}
|
||||
|
||||
public void below(int rowIndex, Node commit, MouseEvent e, List<Node> commitsBeingDragged) {
|
||||
|
||||
}
|
||||
|
||||
public void over(int rowIndex, Node commit, MouseEvent e, List<Node> commitsBeingDragged) {
|
||||
|
||||
}
|
||||
|
||||
public void overNode(int rowIndex, Node commit, MouseEvent e, List<Node> commitsBeingDragged) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Handler drag() {
|
||||
return Handler.EMPTY;
|
||||
}
|
||||
|
||||
public Handler drop() {
|
||||
return Handler.EMPTY;
|
||||
}
|
||||
|
||||
public void draggingStarted(List<Node> commitsBeingDragged) {
|
||||
|
||||
}
|
||||
|
||||
public void draggingCanceled(List<Node> commitsBeingDragged) {
|
||||
|
||||
}
|
||||
|
||||
// This method totally should not be here
|
||||
public void reword(int row, String message) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.intellij.vcs.log.ui;
|
||||
|
||||
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
|
||||
public interface RefAction {
|
||||
void perform(VcsRef ref);
|
||||
}
|
||||
@@ -32,8 +32,6 @@ public class VcsLogUI {
|
||||
@NotNull private final MainFrame myMainFrame;
|
||||
@NotNull private final VcsLogColorManager myColorManager;
|
||||
|
||||
@NotNull private DragDropListener dragDropListener = DragDropListener.EMPTY;
|
||||
|
||||
@Nullable private GraphElement prevGraphElement;
|
||||
@NotNull private TableModel myGraphModel;
|
||||
|
||||
@@ -179,11 +177,6 @@ public class VcsLogUI {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DragDropListener getDragDropListener() {
|
||||
return dragDropListener;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public VcsLogColorManager getColorManager() {
|
||||
return myColorManager;
|
||||
|
||||
@@ -7,11 +7,10 @@ import com.intellij.vcs.log.VcsCommitMiniDetails;
|
||||
import com.intellij.vcs.log.VcsRef;
|
||||
import com.intellij.vcs.log.data.DataPack;
|
||||
import com.intellij.vcs.log.data.VcsLogDataHolder;
|
||||
import com.intellij.vcs.log.data.rebase.FakeCommitParents;
|
||||
import com.intellij.vcs.log.graph.elements.Node;
|
||||
import com.intellij.vcs.log.graph.render.GraphCommitCell;
|
||||
import com.intellij.vcs.log.printmodel.GraphPrintCell;
|
||||
import com.intellij.vcs.log.graph.render.PositionUtil;
|
||||
import com.intellij.vcs.log.printmodel.GraphPrintCell;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
@@ -111,7 +110,6 @@ public class GraphTableModel extends AbstractTableModel {
|
||||
if (applied.contains(hash)) return GraphCommitCell.Kind.APPLIED;
|
||||
if (fixedUp.contains(hash)) return GraphCommitCell.Kind.FIXUP;
|
||||
if (reworded.containsKey(hash)) return GraphCommitCell.Kind.REWORD;
|
||||
if (FakeCommitParents.isFake(hash)) return GraphCommitCell.Kind.PICK;
|
||||
return GraphCommitCell.Kind.NORMAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user