use of org.eclipse.core.runtime.MultiStatus in project egit by eclipse.
the class ConnectProviderOperation method execute.
@Override
public void execute(IProgressMonitor m) throws CoreException {
SubMonitor progress = SubMonitor.convert(m, CoreText.ConnectProviderOperation_connecting, projects.size());
MultiStatus ms = new MultiStatus(Activator.getPluginId(), 0, CoreText.ConnectProviderOperation_ConnectErrors, null);
for (Entry<IProject, File> entry : projects.entrySet()) {
connectProject(entry, ms, progress.newChild(1));
}
if (!ms.isOK()) {
throw new CoreException(ms);
}
}
use of org.eclipse.core.runtime.MultiStatus in project egit by eclipse.
the class FeatureFinishHandler method postMerge.
private void postMerge(final GitFlowRepository gfRepo, final String featureBranch, final boolean squash, final MergeResult mergeResult) {
Display display = Display.getDefault();
display.asyncExec(new Runnable() {
@Override
public void run() {
Shell activeShell = Display.getDefault().getActiveShell();
if (squash && mergeResult.getMergedCommits().length > 1) {
try {
rewordCommitMessage(activeShell, gfRepo);
} catch (CoreException | IOException e) {
throw new RuntimeException(e);
}
}
MergeStatus mergeStatus = mergeResult.getMergeStatus();
if (MergeStatus.CONFLICTING.equals(mergeStatus)) {
String develop = gfRepo.getConfig().getDevelop();
MultiStatus status = createMergeConflictInfo(develop, featureBranch, mergeResult);
ErrorDialog.openError(null, UIText.FeatureFinishHandler_Conflicts, null, status);
}
}
});
}
use of org.eclipse.core.runtime.MultiStatus in project egit by eclipse.
the class HotfixFinishHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
if (gfRepo == null) {
return error(UIText.Handlers_noGitflowRepositoryFound);
}
HotfixFinishOperation hotfixFinishOperation;
try {
hotfixFinishOperation = new HotfixFinishOperation(gfRepo);
String hotfixBranch = gfRepo.getRepository().getBranch();
String develop = gfRepo.getConfig().getDevelop();
JobUtil.scheduleUserWorkspaceJob(hotfixFinishOperation, UIText.HotfixFinishHandler_finishingHotfix, JobFamilies.GITFLOW_FAMILY);
IJobManager jobMan = Job.getJobManager();
jobMan.join(JobFamilies.GITFLOW_FAMILY, null);
MergeResult mergeResult = hotfixFinishOperation.getMergeResult();
MergeStatus mergeStatus = mergeResult.getMergeStatus();
if (!MergeStatus.CONFLICTING.equals(mergeStatus)) {
return null;
}
if (handleConflictsOnMaster(gfRepo)) {
return null;
}
MultiStatus status = createMergeConflictInfo(develop, hotfixBranch, mergeResult);
ErrorDialog.openError(null, UIText.HotfixFinishHandler_Conflicts, null, status);
} catch (WrongGitFlowStateException | CoreException | IOException | OperationCanceledException | InterruptedException e) {
return error(e.getMessage(), e);
}
return null;
}
use of org.eclipse.core.runtime.MultiStatus in project egit by eclipse.
the class AbstractGitFlowHandler method docreateConflictWarning.
private MultiStatus docreateConflictWarning(Iterable<String> paths, String message) {
String pluginId = Activator.getPluginId();
MultiStatus multiStatus = new MultiStatus(pluginId, 1, message, null);
for (String path : paths) {
multiStatus.add(new Status(IStatus.WARNING, pluginId, 1, path, null));
}
return multiStatus;
}
use of org.eclipse.core.runtime.MultiStatus in project egit by eclipse.
the class CherryPickHandler method getErrorList.
private IStatus getErrorList(Map<String, MergeFailureReason> failingPaths) {
MultiStatus result = new MultiStatus(Activator.getPluginId(), IStatus.ERROR, UIText.CherryPickHandler_CherryPickFailedMessage, null);
for (Entry<String, MergeFailureReason> entry : failingPaths.entrySet()) {
String path = entry.getKey();
String reason = getReason(entry.getValue());
String errorMessage = NLS.bind(UIText.CherryPickHandler_ErrorMsgTemplate, path, reason);
result.add(Activator.createErrorStatus(errorMessage));
}
return result;
}
Aggregations