diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/VisibleGraphImpl.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/VisibleGraphImpl.java index dc943d2944b9..25343e24b53e 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/VisibleGraphImpl.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/VisibleGraphImpl.java @@ -63,11 +63,15 @@ public class VisibleGraphImpl implements VisibleGraph { @NotNull @Override public RowInfo getRowInfo(final int visibleRow) { - final int nodeId = myGraphController.getCompiledGraph().getNodeId(visibleRow); + final int nodeId = getNodeId(visibleRow); assert nodeId >= 0; // todo remake for all id return new RowInfoImpl(nodeId, visibleRow); } + public int getNodeId(int visibleRow) { + return myGraphController.getCompiledGraph().getNodeId(visibleRow); + } + @Override @Nullable public Integer getVisibleRowIndex(@NotNull CommitId commitId) { @@ -113,7 +117,7 @@ public class VisibleGraphImpl implements VisibleGraph { @Nullable private Integer convertToNodeId(@Nullable Integer nodeIndex) { if (nodeIndex == null) return null; - return myGraphController.getCompiledGraph().getNodeId(nodeIndex); + return getNodeId(nodeIndex); } @Nullable @@ -259,7 +263,7 @@ public class VisibleGraphImpl implements VisibleGraph { } } - public class RowInfoImpl implements RowInfo { + private class RowInfoImpl implements RowInfo { private final int myNodeId; private final int myVisibleRow; @@ -268,10 +272,6 @@ public class VisibleGraphImpl implements VisibleGraph { myVisibleRow = visibleRow; } - public int getNodeId() { - return myNodeId; - } - @NotNull @Override public CommitId getCommit() { diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryFilterer.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryFilterer.java index 8be6b533f33a..1f9747afa4c3 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryFilterer.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryFilterer.java @@ -213,24 +213,22 @@ class FileHistoryFilterer extends VcsLogFilterer { } @Override - public void enterNode(int node, int previousNode) { + public void enterNode(int currentNode, int previousNode) { FilePath previousPath = myPaths.peek(); - RowInfo currentRowInfo = myVisibleGraph.getRowInfo(node); - int currentCommit = currentRowInfo.getCommit(); - int currentNodeId = ((VisibleGraphImpl.RowInfoImpl)currentRowInfo).getNodeId(); + int currentNodeId = myVisibleGraph.getNodeId(currentNode); + int currentCommit = myPermanentCommitsInfo.getCommitId(currentNodeId); if (previousNode == DfsUtil.NextNode.NODE_NOT_FOUND) { myPathsForCommits.put(currentCommit, previousPath); myPaths.push(previousPath); } else { - FilePath currentPath; - RowInfo previousRowInfo = myVisibleGraph.getRowInfo(previousNode); - int previousCommit = previousRowInfo.getCommit(); - int previousNodeId = ((VisibleGraphImpl.RowInfoImpl)previousRowInfo).getNodeId(); + int previousNodeId = myVisibleGraph.getNodeId(previousNode); + int previousCommit = myPermanentCommitsInfo.getCommitId(previousNodeId); + FilePath currentPath; // checking which node is the parent and which is the child - if (myLinearVisibleGraph.getNodes(node, LiteLinearGraph.NodeFilter.DOWN).contains(previousNode)) { + if (myLinearVisibleGraph.getNodes(currentNode, LiteLinearGraph.NodeFilter.DOWN).contains(previousNode)) { // since in reality there is no edge between the nodes, but the whole path, we need to know, which parent is affected by this path int parentIndex = BfsUtil.getCorrespondingParent(myPermanentLinearGraph, currentNodeId, previousNodeId, myVisibilityBuffer); currentPath = myNamesData.getPathInChildRevision(currentCommit, myPermanentCommitsInfo.getCommitId(parentIndex), previousPath);