use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgQNewCommand method executeQRefreshInCurrentThread.
private void executeQRefreshInCurrentThread(@NotNull List<String> chunkFiles) throws VcsException {
List<String> args = ContainerUtil.newArrayList();
args.add("-l");
args.add(saveCommitMessage().getAbsolutePath());
args.add("-s");
args.addAll(chunkFiles);
HgCommandResult result = new HgCommandExecutor(myProject).executeInCurrentThread(myRepository.getRoot(), "qrefresh", args);
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(myProject).notifyError(result, "QRefresh Failed", "Could not amend selected changes to newly created patch");
}
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgQPushCommand method executeInCurrentThread.
public void executeInCurrentThread(@NotNull final String patchName) {
final Project project = myRepository.getProject();
HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(myRepository.getRoot(), "qpush", Arrays.asList("--move", patchName));
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "QPush command failed", "Could not apply selected patch " + patchName);
}
myRepository.update();
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor in project intellij-community by JetBrains.
the class HgQRenameCommand method performPatchRename.
public static void performPatchRename(@NotNull final HgRepository repository, @NotNull final String oldName, @NotNull final String newName) {
if (oldName.equals(newName))
return;
final Project project = repository.getProject();
new HgCommandExecutor(project).execute(repository.getRoot(), "qrename", Arrays.asList(oldName, newName), new HgCommandResultHandler() {
@Override
public void process(@Nullable HgCommandResult result) {
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
new HgCommandResultNotifier(project).notifyError(result, "Qrename command failed", "Could not rename patch " + oldName + " to " + newName);
}
repository.update();
}
});
}
use of org.zmlx.hg4idea.execution.HgCommandExecutor 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.execution.HgCommandExecutor 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;
}
Aggregations