use of com.intellij.vcs.log.graph.collapsing.CollapsedController in project intellij-community by JetBrains.
the class SnapshotVisiblePackBuilder method build.
@NotNull
private VisiblePack build(@NotNull DataPackBase oldPack, @NotNull VisibleGraphImpl<Integer> oldGraph, @NotNull VcsLogFilterCollection filters) {
final PermanentGraphInfo<Integer> info = oldGraph.buildSimpleGraphInfo();
Set<Integer> heads = ContainerUtil.map2Set(info.getPermanentGraphLayout().getHeadNodeIndex(), integer -> info.getPermanentCommitsInfo().getCommitId(integer));
RefsModel newRefsModel = createRefsModel(oldPack.getRefsModel(), heads, oldGraph, oldPack.getLogProviders());
DataPackBase newPack = new DataPackBase(oldPack.getLogProviders(), newRefsModel, false);
GraphColorManagerImpl colorManager = new GraphColorManagerImpl(newRefsModel, VcsLogStorageImpl.createHashGetter(myStorage), DataPack.getRefManagerMap(oldPack.getLogProviders()));
VisibleGraph<Integer> newGraph = new VisibleGraphImpl<>(new CollapsedController(new BaseController(info), info, null), info, colorManager);
return new VisiblePack(newPack, newGraph, true, filters);
}
use of com.intellij.vcs.log.graph.collapsing.CollapsedController 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