Search in sources :

Example 1 with GraphColorManagerImpl

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);
}
Also used : GraphColorManagerImpl(com.intellij.vcs.log.graph.GraphColorManagerImpl) Hash(com.intellij.vcs.log.Hash) StopWatch(com.intellij.vcs.log.util.StopWatch) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with GraphColorManagerImpl

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);
}
Also used : VisibleGraphImpl(com.intellij.vcs.log.graph.impl.facade.VisibleGraphImpl) GraphColorManagerImpl(com.intellij.vcs.log.graph.GraphColorManagerImpl) BaseController(com.intellij.vcs.log.graph.impl.facade.BaseController) CollapsedController(com.intellij.vcs.log.graph.collapsing.CollapsedController) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GraphColorManagerImpl (com.intellij.vcs.log.graph.GraphColorManagerImpl)2 NotNull (org.jetbrains.annotations.NotNull)2 Hash (com.intellij.vcs.log.Hash)1 CollapsedController (com.intellij.vcs.log.graph.collapsing.CollapsedController)1 BaseController (com.intellij.vcs.log.graph.impl.facade.BaseController)1 VisibleGraphImpl (com.intellij.vcs.log.graph.impl.facade.VisibleGraphImpl)1 StopWatch (com.intellij.vcs.log.util.StopWatch)1