Search in sources :

Example 1 with ReleaseStartOperation

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

the class BranchNameValidatorTest method testBranchNotExists.

@Test
public void testBranchNotExists() throws Exception {
    testRepository.createInitialCommit("testInitOperation\n\nfirst commit\n");
    Repository repository = testRepository.getRepository();
    new InitOperation(repository).execute(null);
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
    assertFalse(releaseExists(gfRepo, "notThere"));
}
Also used : Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test) AbstractGitFlowOperationTest(org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)

Example 2 with ReleaseStartOperation

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

the class BranchNameValidatorTest method testReleaseExists.

@Test
public void testReleaseExists() throws Exception {
    testRepository.createInitialCommit("testInitOperation\n\nfirst commit\n");
    Repository repository = testRepository.getRepository();
    new InitOperation(repository).execute(null);
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
    assertTrue(releaseExists(gfRepo, MY_RELEASE));
}
Also used : Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test) AbstractGitFlowOperationTest(org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)

Example 3 with ReleaseStartOperation

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

the class GitFlowRepositoryTest method testGetReleaseBranches.

@Test
public void testGetReleaseBranches() throws Exception {
    repository1.createInitialCommit("testGetReleaseBranches\n\nfirst commit\n");
    Repository repository = repository1.getRepository();
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    new InitOperation(repository).execute(null);
    assertTrue(gfRepo.getReleaseBranches().isEmpty());
    new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
    assertEquals(R_HEADS + gfRepo.getConfig().getReleasePrefix() + MY_RELEASE, gfRepo.getReleaseBranches().get(0).getName());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test)

Example 4 with ReleaseStartOperation

use of org.eclipse.egit.gitflow.op.ReleaseStartOperation 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());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Repository(org.eclipse.jgit.lib.Repository) ReleaseFinishOperation(org.eclipse.egit.gitflow.op.ReleaseFinishOperation) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) HotfixStartOperation(org.eclipse.egit.gitflow.op.HotfixStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test)

Example 5 with ReleaseStartOperation

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

the class ReleaseStartHandler method doExecute.

void doExecute(GitFlowRepository gfRepo, final String startCommitSha1, Shell activeShell) {
    InputDialog inputDialog = new InputDialog(activeShell, UIText.ReleaseStartHandler_provideReleaseName, // $NON-NLS-1$
    UIText.ReleaseStartHandler_provideANameForTheNewRelease, // $NON-NLS-1$
    "", new ReleaseNameValidator(gfRepo));
    if (inputDialog.open() != Window.OK) {
        return;
    }
    final String releaseName = inputDialog.getValue();
    ReleaseStartOperation releaseStartOperation = new ReleaseStartOperation(gfRepo, startCommitSha1, releaseName);
    JobUtil.scheduleUserWorkspaceJob(releaseStartOperation, UIText.ReleaseStartHandler_startingNewRelease, JobFamilies.GITFLOW_FAMILY);
}
Also used : InputDialog(org.eclipse.jface.dialogs.InputDialog) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) ReleaseNameValidator(org.eclipse.egit.gitflow.ui.internal.validation.ReleaseNameValidator)

Aggregations

ReleaseStartOperation (org.eclipse.egit.gitflow.op.ReleaseStartOperation)5 InitOperation (org.eclipse.egit.gitflow.op.InitOperation)4 Repository (org.eclipse.jgit.lib.Repository)4 Test (org.junit.Test)4 TestRepository (org.eclipse.egit.core.test.TestRepository)2 AbstractGitFlowOperationTest (org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)2 HotfixStartOperation (org.eclipse.egit.gitflow.op.HotfixStartOperation)1 ReleaseFinishOperation (org.eclipse.egit.gitflow.op.ReleaseFinishOperation)1 ReleaseNameValidator (org.eclipse.egit.gitflow.ui.internal.validation.ReleaseNameValidator)1 InputDialog (org.eclipse.jface.dialogs.InputDialog)1