use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class FeatureStartFinishHandlerTest method testFeatureStart.
@Test
public void testFeatureStart() throws Exception {
init();
setContentAddAndCommit("bar");
createFeature(FEATURE_NAME);
RevCommit featureBranchCommit = setContentAddAndCommit("foo");
checkoutBranch(DEVELOP);
checkoutFeature(FEATURE_NAME);
finishFeature();
GitFlowRepository gfRepo = new GitFlowRepository(repository);
RevCommit developHead = gfRepo.findHead();
assertEquals(developHead, featureBranchCommit);
assertNull(findBranch(gfRepo.getConfig().getFeatureBranchName(FEATURE_NAME)));
IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
assertFalse(prefStore.getBoolean(FEATURE_FINISH_SQUASH));
assertFalse(prefStore.getBoolean(FEATURE_FINISH_KEEP_BRANCH));
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class InitHandlerTest method testInitEmptyRepoMissingMaster.
@Test
public void testInitEmptyRepoMissingMaster() throws Exception {
String projectName = "AnyProjectName";
TestRepository testRepository = createAndShare(projectName);
selectProject(projectName);
clickInit();
bot.button("Yes").click();
fillDialog(MASTER_BRANCH_MISSING);
bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing));
bot.button("Yes").click();
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
Repository localRepository = testRepository.getRepository();
GitFlowRepository gitFlowRepository = new GitFlowRepository(localRepository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, localRepository.getBranch());
assertEquals(MASTER_BRANCH_MISSING, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
assertNotNull(localRepository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class InitHandlerTest method testInit.
@Test
public void testInit() throws Exception {
selectProject(PROJ1);
clickInit();
fillDialog(MASTER_BRANCH);
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
GitFlowRepository gitFlowRepository = new GitFlowRepository(repository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, repository.getBranch());
assertEquals(MASTER_BRANCH, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class AbstractDualRepositoryTestCase method assertCommitArrivedAtRemote.
protected void assertCommitArrivedAtRemote(RevCommit branchCommit, Repository remote) throws CoreException {
GitFlowRepository gfRepo = new GitFlowRepository(remote);
BranchOperation checkoutOperation = new BranchOperation(remote, gfRepo.getConfig().getFullFeatureBranchName(MY_FEATURE));
checkoutOperation.execute(null);
RevCommit developHead = findHead(remote);
assertEquals(branchCommit, developHead);
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class DynamicHistoryMenu method fill.
@Override
public void fill(Menu menu, int index) {
GitFlowRepository gfRepo = getRepository();
if (gfRepo == null) {
return;
}
RevCommit selectedCommit = getSelectedCommit();
if (selectedCommit == null) {
return;
}
String startCommitSha1 = selectedCommit.getName();
Shell activeShell = getActiveShell();
ReleaseStartFromCommitHandler listener = new ReleaseStartFromCommitHandler(gfRepo, startCommitSha1, activeShell);
MenuItem menuItem = new MenuItem(menu, SWT.PUSH, index);
menuItem.setText(NLS.bind(UIText.DynamicHistoryMenu_startGitflowReleaseFrom, abbreviate(selectedCommit)));
menuItem.addSelectionListener(listener);
boolean isEnabled = false;
try {
isEnabled = gfRepo.isOnDevelop(selectedCommit);
} catch (IOException e) {
Activator.getDefault().getLog().log(error(e.getMessage(), e));
}
menuItem.setEnabled(isEnabled);
}
Aggregations