use of org.zmlx.hg4idea.command.HgGraftCommand in project intellij-community by JetBrains.
the class HgCherryPicker method processGrafting.
private static void processGrafting(@NotNull HgRepository repository, @NotNull List<String> hashes) {
Project project = repository.getProject();
VirtualFile root = repository.getRoot();
HgGraftCommand command = new HgGraftCommand(project, repository);
HgCommandResult result = command.startGrafting(hashes);
boolean hasConflicts = HgConflictResolver.hasConflicts(project, root);
if (!hasConflicts && HgErrorUtil.isCommandExecutionFailed(result)) {
new HgCommandResultNotifier(project).notifyError(result, "Hg Error", "Couldn't graft.");
return;
}
final UpdatedFiles updatedFiles = UpdatedFiles.create();
while (hasConflicts) {
new HgConflictResolver(project, updatedFiles).resolve(root);
hasConflicts = HgConflictResolver.hasConflicts(project, root);
if (!hasConflicts) {
result = command.continueGrafting();
hasConflicts = HgConflictResolver.hasConflicts(project, root);
} else {
new HgCommandResultNotifier(project).notifyError(result, "Hg Error", "Couldn't continue grafting");
break;
}
}
repository.update();
root.refresh(true, true);
}
Aggregations