use of org.zmlx.hg4idea.repo.HgRepositoryManager in project intellij-community by JetBrains.
the class HgTagCreateCommand method executeAsynchronously.
public void executeAsynchronously(HgCommandResultHandler resultHandler) throws HgCommandException {
if (StringUtil.isEmptyOrSpaces(tagName)) {
throw new HgCommandException("tag name is empty");
}
List<String> arguments = new ArrayList<>();
arguments.add(tagName);
if (!StringUtil.isEmptyOrSpaces(revisionNumberOrHash)) {
arguments.add("--rev");
arguments.add(revisionNumberOrHash);
}
new HgCommandExecutor(project).execute(repo, "tag", arguments, resultHandler);
if (!project.isDisposed()) {
HgRepositoryManager manager = HgUtil.getRepositoryManager(project);
manager.updateRepository(repo);
}
}
use of org.zmlx.hg4idea.repo.HgRepositoryManager in project intellij-community by JetBrains.
the class HgUtil method groupFilePathsByHgRoots.
@NotNull
public static Map<VirtualFile, Collection<FilePath>> groupFilePathsByHgRoots(@NotNull Project project, @NotNull Collection<FilePath> files) {
Map<VirtualFile, Collection<FilePath>> sorted = new HashMap<>();
if (project.isDisposed())
return sorted;
HgRepositoryManager repositoryManager = getRepositoryManager(project);
for (FilePath file : files) {
HgRepository repo = repositoryManager.getRepositoryForFile(file);
if (repo == null) {
continue;
}
Collection<FilePath> filesForRoot = sorted.get(repo.getRoot());
if (filesForRoot == null) {
filesForRoot = new HashSet<>();
sorted.put(repo.getRoot(), filesForRoot);
}
filesForRoot.add(file);
}
return sorted;
}
Aggregations