Search in sources :

Example 1 with FeatureRebaseOperation

use of org.eclipse.egit.gitflow.op.FeatureRebaseOperation in project egit by eclipse.

the class FeatureRebaseHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
    FeatureRebaseOperation rebaseOperation = new FeatureRebaseOperation(gfRepo);
    JobUtil.scheduleUserWorkspaceJob(rebaseOperation, UIText.FeatureRebaseHandler_rebasingFeature, JobFamilies.GITFLOW_FAMILY);
    IJobManager jobMan = Job.getJobManager();
    try {
        jobMan.join(GITFLOW_FAMILY, null);
    } catch (OperationCanceledException | InterruptedException e) {
        return error(e.getMessage(), e);
    }
    RebaseResult operationResult = rebaseOperation.getOperationResult();
    RebaseResult.Status status = operationResult.getStatus();
    if (status.isSuccessful()) {
        return null;
    }
    if (STOPPED.equals(status)) {
        try {
            showInteractiveRebaseView(event);
        } catch (PartInitException e) {
            return error(e.getMessage(), e);
        }
    }
    openWarning(operationResult);
    return null;
}
Also used : OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) IJobManager(org.eclipse.core.runtime.jobs.IJobManager) PartInitException(org.eclipse.ui.PartInitException) FeatureRebaseOperation(org.eclipse.egit.gitflow.op.FeatureRebaseOperation) GitFlowRepository(org.eclipse.egit.gitflow.GitFlowRepository) RebaseResult(org.eclipse.jgit.api.RebaseResult)

Aggregations

OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 IJobManager (org.eclipse.core.runtime.jobs.IJobManager)1 GitFlowRepository (org.eclipse.egit.gitflow.GitFlowRepository)1 FeatureRebaseOperation (org.eclipse.egit.gitflow.op.FeatureRebaseOperation)1 RebaseResult (org.eclipse.jgit.api.RebaseResult)1 PartInitException (org.eclipse.ui.PartInitException)1