Search in sources :

Example 1 with HgCurrentBinaryContentRevision

use of org.zmlx.hg4idea.provider.HgCurrentBinaryContentRevision in project intellij-community by JetBrains.

the class HgCheckinEnvironment method addFile.

private void addFile(Map<HgRepository, Set<HgFile>> result, ContentRevision contentRevision) {
    FilePath filePath = contentRevision.getFile();
    // try to find repository from hgFile from change: to be able commit sub repositories as expected
    HgRepository repo = HgUtil.getRepositoryForFile(myProject, contentRevision instanceof HgCurrentBinaryContentRevision ? ((HgCurrentBinaryContentRevision) contentRevision).getRepositoryRoot() : ChangesUtil.findValidParentAccurately(filePath));
    if (repo == null) {
        return;
    }
    Set<HgFile> hgFiles = result.get(repo);
    if (hgFiles == null) {
        hgFiles = new HashSet<>();
        result.put(repo, hgFiles);
    }
    hgFiles.add(new HgFile(repo.getRoot(), filePath));
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) HgRepository(org.zmlx.hg4idea.repo.HgRepository) HgCurrentBinaryContentRevision(org.zmlx.hg4idea.provider.HgCurrentBinaryContentRevision)

Aggregations

FilePath (com.intellij.openapi.vcs.FilePath)1 HgCurrentBinaryContentRevision (org.zmlx.hg4idea.provider.HgCurrentBinaryContentRevision)1 HgRepository (org.zmlx.hg4idea.repo.HgRepository)1