Search in sources :

Example 1 with PermanentGraph

use of com.intellij.vcs.log.graph.PermanentGraph in project intellij-community by JetBrains.

the class FileHistoryFilterer method getCurrentRow.

private int getCurrentRow(@NotNull DataPack pack, @NotNull VisibleGraph<Integer> visibleGraph, @NotNull IndexDataGetter.FileNamesData fileIndexData) {
    PermanentGraph<Integer> permanentGraph = pack.getPermanentGraph();
    if (permanentGraph instanceof PermanentGraphImpl) {
        CompressedRefs refs = pack.getRefsModel().getAllRefsByRoot().get(myRoot);
        Optional<VcsRef> headOptional = refs.streamBranches().filter(br -> br.getName().equals("HEAD")).findFirst();
        if (headOptional.isPresent()) {
            VcsRef head = headOptional.get();
            assert head.getRoot().equals(myRoot);
            return findAncestorRowAffectingFile((PermanentGraphImpl<Integer>) permanentGraph, head.getCommitHash(), visibleGraph, fileIndexData);
        }
    }
    return -1;
}
Also used : CompressedRefs(com.intellij.vcs.log.data.CompressedRefs) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VisiblePack(com.intellij.vcs.log.visible.VisiblePack) DataPack(com.intellij.vcs.log.data.DataPack) ContainerUtil(com.intellij.util.containers.ContainerUtil) ReachableNodes(com.intellij.vcs.log.graph.impl.facade.ReachableNodes) VcsLogFilterer(com.intellij.vcs.log.visible.VcsLogFilterer) PermanentGraphImpl(com.intellij.vcs.log.graph.impl.facade.PermanentGraphImpl) Stack(com.intellij.util.containers.Stack) VisibleGraph(com.intellij.vcs.log.graph.VisibleGraph) VcsLogData(com.intellij.vcs.log.data.VcsLogData) LinearGraph(com.intellij.vcs.log.graph.api.LinearGraph) VisibleGraphImpl(com.intellij.vcs.log.graph.impl.facade.VisibleGraphImpl) FilePath(com.intellij.openapi.vcs.FilePath) VcsUtil(com.intellij.vcsUtil.VcsUtil) LinearGraphUtils(com.intellij.vcs.log.graph.utils.LinearGraphUtils) Set(java.util.Set) PermanentCommitsInfoImpl(com.intellij.vcs.log.graph.impl.permanent.PermanentCommitsInfoImpl) VcsRef(com.intellij.vcs.log.VcsRef) DfsUtil(com.intellij.vcs.log.graph.utils.DfsUtil) VcsLogFilterCollection(com.intellij.vcs.log.VcsLogFilterCollection) Nullable(org.jetbrains.annotations.Nullable) Hash(com.intellij.vcs.log.Hash) IndexDataGetter(com.intellij.vcs.log.data.index.IndexDataGetter) PermanentGraph(com.intellij.vcs.log.graph.PermanentGraph) Optional(java.util.Optional) ObjectUtils(com.intellij.util.ObjectUtils) NotNull(org.jetbrains.annotations.NotNull) Ref(com.intellij.openapi.util.Ref) Collections(java.util.Collections) VcsRef(com.intellij.vcs.log.VcsRef) CompressedRefs(com.intellij.vcs.log.data.CompressedRefs) PermanentGraphImpl(com.intellij.vcs.log.graph.impl.facade.PermanentGraphImpl)

Aggregations

Ref (com.intellij.openapi.util.Ref)1 FilePath (com.intellij.openapi.vcs.FilePath)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ObjectUtils (com.intellij.util.ObjectUtils)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 Stack (com.intellij.util.containers.Stack)1 Hash (com.intellij.vcs.log.Hash)1 VcsLogFilterCollection (com.intellij.vcs.log.VcsLogFilterCollection)1 VcsRef (com.intellij.vcs.log.VcsRef)1 CompressedRefs (com.intellij.vcs.log.data.CompressedRefs)1 DataPack (com.intellij.vcs.log.data.DataPack)1 VcsLogData (com.intellij.vcs.log.data.VcsLogData)1 IndexDataGetter (com.intellij.vcs.log.data.index.IndexDataGetter)1 PermanentGraph (com.intellij.vcs.log.graph.PermanentGraph)1 VisibleGraph (com.intellij.vcs.log.graph.VisibleGraph)1 LinearGraph (com.intellij.vcs.log.graph.api.LinearGraph)1 PermanentGraphImpl (com.intellij.vcs.log.graph.impl.facade.PermanentGraphImpl)1 ReachableNodes (com.intellij.vcs.log.graph.impl.facade.ReachableNodes)1 VisibleGraphImpl (com.intellij.vcs.log.graph.impl.facade.VisibleGraphImpl)1 PermanentCommitsInfoImpl (com.intellij.vcs.log.graph.impl.permanent.PermanentCommitsInfoImpl)1