use of com.intellij.vcs.log.graph.linearBek.LinearBekController in project intellij-community by JetBrains.
the class PermanentGraphImpl method createVisibleGraph.
@NotNull
@Override
public VisibleGraph<CommitId> createVisibleGraph(@NotNull SortType sortType, @Nullable Set<CommitId> visibleHeads, @Nullable Set<CommitId> matchingCommits) {
CascadeController baseController;
if (sortType == SortType.Normal) {
baseController = new BaseController(this);
} else if (sortType == SortType.LinearBek) {
baseController = new LinearBekController(new BekBaseController(this, myBekIntMap.get()), this);
} else {
baseController = new BekBaseController(this, myBekIntMap.get());
}
// TODO this code is unclear and obviously needs some refactoring
// I'll leave it for later to reorganize, and add some duplication for now, in order just to fix stuff
CascadeController controller;
if (matchingCommits != null) {
controller = new FilteredController(baseController, this, myPermanentCommitsInfo.convertToNodeIds(matchingCommits));
if (visibleHeads != null) {
controller = new BranchFilterController(controller, this, myPermanentCommitsInfo.convertToNodeIds(visibleHeads, true));
}
} else if (sortType == SortType.LinearBek) {
if (visibleHeads != null) {
controller = new BranchFilterController(baseController, this, myPermanentCommitsInfo.convertToNodeIds(visibleHeads, true));
} else {
controller = baseController;
}
} else {
Set<Integer> idOfVisibleBranches = null;
if (visibleHeads != null) {
idOfVisibleBranches = myPermanentCommitsInfo.convertToNodeIds(visibleHeads, true);
}
controller = new CollapsedController(baseController, this, idOfVisibleBranches);
}
return new VisibleGraphImpl<>(controller, this, myGraphColorManager);
}
Aggregations