use of org.eclipse.egit.gitflow.op.ReleaseFinishOperation in project egit by eclipse.
the class GitFlowRepositoryTest method testGetHotfixBranches.
@Test
public void testGetHotfixBranches() throws Exception {
repository1.createInitialCommit("testGetHotfixBranches\n\nfirst commit\n");
Repository repository = repository1.getRepository();
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new InitOperation(repository).execute(null);
assertTrue(gfRepo.getHotfixBranches().isEmpty());
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
new ReleaseFinishOperation(gfRepo, MY_RELEASE).execute(null);
new HotfixStartOperation(gfRepo, MY_HOTFIX).execute(null);
assertEquals(R_HEADS + gfRepo.getConfig().getHotfixPrefix() + MY_HOTFIX, gfRepo.getHotfixBranches().get(0).getName());
}
use of org.eclipse.egit.gitflow.op.ReleaseFinishOperation in project egit by eclipse.
the class ReleaseFinishHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
if (gfRepo == null) {
return error(UIText.Handlers_noGitflowRepositoryFound);
}
final ReleaseFinishOperation releaseFinishOperation;
try {
releaseFinishOperation = new ReleaseFinishOperation(gfRepo);
String releaseBranch = gfRepo.getRepository().getBranch();
String develop = gfRepo.getConfig().getDevelop();
JobUtil.scheduleUserWorkspaceJob(releaseFinishOperation, UIText.ReleaseFinishHandler_finishingRelease, JobFamilies.GITFLOW_FAMILY);
IJobManager jobMan = Job.getJobManager();
jobMan.join(JobFamilies.GITFLOW_FAMILY, null);
MergeResult mergeResult = releaseFinishOperation.getMergeResult();
MergeStatus mergeStatus = mergeResult.getMergeStatus();
if (!MergeStatus.CONFLICTING.equals(mergeStatus)) {
return null;
}
if (handleConflictsOnMaster(gfRepo)) {
return null;
}
MultiStatus status = createMergeConflictInfo(develop, releaseBranch, mergeResult);
ErrorDialog.openError(null, UIText.ReleaseFinishHandler_Conflicts, null, status);
} catch (WrongGitFlowStateException | CoreException | IOException | OperationCanceledException | InterruptedException e) {
return error(e.getMessage(), e);
}
return null;
}
Aggregations