Search in sources :

Example 21 with Hash

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

the class HgCompareWithBranchAction method getBranchNamesExceptCurrent.

@NotNull
@Override
protected List<String> getBranchNamesExceptCurrent(@NotNull HgRepository repository) {
    final List<String> namesToCompare = new ArrayList<>(repository.getBranches().keySet());
    final String currentBranchName = repository.getCurrentBranchName();
    assert currentBranchName != null;
    final Hash currentHash = getCurrentHash(repository);
    if (currentHash.equals(getHeavyBranchMainHash(repository, currentBranchName))) {
        namesToCompare.remove(currentBranchName);
    }
    namesToCompare.addAll(HgUtil.getNamesWithoutHashes(getOtherBookmarks(repository, currentHash)));
    return namesToCompare;
}
Also used : Hash(com.intellij.vcs.log.Hash) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Hash (com.intellij.vcs.log.Hash)21 NotNull (org.jetbrains.annotations.NotNull)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 Test (org.junit.Test)4 VcsRef (com.intellij.vcs.log.VcsRef)2 GitRepository (git4idea.repo.GitRepository)2 HgNameWithHashInfo (org.zmlx.hg4idea.HgNameWithHashInfo)2 RepoStateException (com.intellij.dvcs.repo.RepoStateException)1 AccessToken (com.intellij.openapi.application.AccessToken)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 Project (com.intellij.openapi.project.Project)1 FilePath (com.intellij.openapi.vcs.FilePath)1 VcsException (com.intellij.openapi.vcs.VcsException)1 Change (com.intellij.openapi.vcs.changes.Change)1 MultiMap (com.intellij.util.containers.MultiMap)1 CommitId (com.intellij.vcs.log.CommitId)1 GraphColorManagerImpl (com.intellij.vcs.log.graph.GraphColorManagerImpl)1 StopWatch (com.intellij.vcs.log.util.StopWatch)1 GitLocalBranch (git4idea.GitLocalBranch)1