use of com.intellij.vcs.log.graph.GraphColorManagerImpl in project intellij-community by JetBrains.
the class DataPack method build.
@NotNull
public static DataPack build(@NotNull List<? extends GraphCommit<Integer>> commits, @NotNull Map<VirtualFile, CompressedRefs> refs, @NotNull Map<VirtualFile, VcsLogProvider> providers, @NotNull VcsLogStorage storage, boolean full) {
RefsModel refsModel;
PermanentGraph<Integer> permanentGraph;
if (commits.isEmpty()) {
refsModel = new RefsModel(refs, ContainerUtil.newHashSet(), storage, providers);
permanentGraph = EmptyPermanentGraph.getInstance();
} else {
refsModel = new RefsModel(refs, getHeads(commits), storage, providers);
Function<Integer, Hash> hashGetter = VcsLogStorageImpl.createHashGetter(storage);
GraphColorManagerImpl colorManager = new GraphColorManagerImpl(refsModel, hashGetter, getRefManagerMap(providers));
Set<Integer> branches = getBranchCommitHashIndexes(refsModel.getBranches(), storage);
StopWatch sw = StopWatch.start("building graph");
permanentGraph = PermanentGraphImpl.newInstance(commits, colorManager, branches);
sw.report();
}
return new DataPack(refsModel, permanentGraph, providers, full);
}
use of com.intellij.vcs.log.graph.GraphColorManagerImpl 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);
}
Aggregations