use of org.eclipse.egit.gitflow.op.HotfixFinishOperation 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;
}
Aggregations