use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgQDeleteCommand method executeInCurrentThread.
public void executeInCurrentThread(@NotNull final List<String> patchNames) {
final Project project = myRepository.getProject();
HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(myRepository.getRoot(), "qdelete", patchNames);
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "QDelete command failed", "Could not delete selected " + StringUtil.pluralize("patch", patchNames.size()));
}
myRepository.update();
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgQFoldCommand method executeInCurrentThread.
public void executeInCurrentThread(@NotNull final List<String> patchNames) {
final Project project = myRepository.getProject();
HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(myRepository.getRoot(), "qfold", patchNames);
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "QFold command failed", "Could not fold patches into the current patch");
}
myRepository.update();
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgAddCommand method addFilesSynchronously.
private void addFilesSynchronously(VirtualFile repo, Collection<VirtualFile> files, @Nullable ProgressIndicator indicator) {
final List<List<String>> chunks = VcsFileUtil.chunkFiles(repo, files);
int currentChunk = 0;
for (List<String> paths : chunks) {
if (indicator != null) {
if (indicator.isCanceled())
return;
indicator.setFraction((double) currentChunk / chunks.size());
currentChunk++;
}
new HgCommandExecutor(myProject).executeInCurrentThread(repo, "add", paths);
}
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgAnnotateCommand method execute.
public List<HgAnnotationLine> execute(@NotNull HgFile hgFile, @Nullable HgRevisionNumber revision) {
final List<String> arguments = new ArrayList<>();
arguments.add("-cvnudl");
HgVcs vcs = HgVcs.getInstance(myProject);
if (vcs != null && vcs.getProjectSettings().isWhitespacesIgnoredInAnnotations() && vcs.getVersion().isIgnoreWhitespaceDiffInAnnotationsSupported()) {
arguments.add("-w");
}
if (revision != null) {
arguments.add("-r");
arguments.add(revision.getChangeset());
}
arguments.add(hgFile.getRelativePath());
final HgCommandResult result = new HgCommandExecutor(myProject).executeInCurrentThread(hgFile.getRepo(), "annotate", arguments);
if (result == null) {
return Collections.emptyList();
}
List<String> outputLines = result.getOutputLines();
return parse(outputLines);
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgBookmarkCommand method executeBookmarkCommandSynchronously.
private static void executeBookmarkCommandSynchronously(@NotNull Project project, @NotNull VirtualFile repositoryRoot, @NotNull String name, @NotNull List<String> args) {
ArrayList<String> arguments = ContainerUtil.newArrayList(args);
arguments.add(name);
HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(repositoryRoot, "bookmark", arguments);
getRepositoryManager(project).updateRepository(repositoryRoot);
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "Hg Error", String.format("Hg bookmark command failed for repository %s with name %s ", repositoryRoot.getName(), name));
}
}
Aggregations