use of org.zmlx.hg4idea.action.HgCommandResultNotifier in project intellij-community by JetBrains.
the class HgQNewCommand method executeQNewInCurrentThread.
private void executeQNewInCurrentThread(@NotNull List<String> chunkFiles) throws VcsException {
List<String> args = ContainerUtil.newArrayList();
args.add("-l");
args.add(saveCommitMessage().getAbsolutePath());
args.add("-UD");
String patchName = DATE_FORMAT.format(new Date()).concat(".diff");
args.add(patchName);
args.addAll(chunkFiles);
HgCommandExecutor executor = new HgCommandExecutor(myProject);
HgCommandResult result = executor.executeInCurrentThread(myRepository.getRoot(), "qnew", args);
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(myProject).notifyError(result, "Qnew Failed", "Could not create mq patch for selected changes");
}
}
use of org.zmlx.hg4idea.action.HgCommandResultNotifier in project intellij-community by JetBrains.
the class HgQPopCommand method executeInCurrentThread.
public HgCommandResult executeInCurrentThread() {
final Project project = myRepository.getProject();
HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(myRepository.getRoot(), "qpop", Collections.singletonList("--all"));
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "QPop command failed", "Could not make all patches unapplied");
} else {
assert result != null;
if (!result.getErrorLines().isEmpty()) {
VcsNotifier.getInstance(project).notifyWarning("QPop completed with errors", result.getRawError());
}
}
myRepository.update();
return result;
}
use of org.zmlx.hg4idea.action.HgCommandResultNotifier 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.action.HgCommandResultNotifier 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.action.HgCommandResultNotifier 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