Search in sources :

Example 1 with GenericHistoryView

use of org.eclipse.team.internal.ui.history.GenericHistoryView in project egit by eclipse.

the class SelectionForViewsTest method before.

@Before
public void before() throws Exception {
    localRepositoryDir = createProjectAndCommitToRepository();
    remoteRepositoryDir = createRemoteRepository(localRepositoryDir);
    URIish uri = new URIish("file:///" + remoteRepositoryDir.getPath());
    File workdir = new File(getTestDirectory(), "ClonedRepo");
    CloneOperation op = new CloneOperation(uri, true, null, workdir, "refs/heads/master", "origin", 0);
    op.run(null);
    clonedRepositoryDir = new File(workdir, Constants.DOT_GIT);
    RepositoryUtil repoUtil = Activator.getDefault().getRepositoryUtil();
    repoUtil.addConfiguredRepository(localRepositoryDir);
    repoUtil.addConfiguredRepository(clonedRepositoryDir);
    // it's bare
    repoUtil.addConfiguredRepository(remoteRepositoryDir);
    stagingView = TestUtil.showView(StagingView.VIEW_ID);
    reflogView = TestUtil.showView(ReflogView.VIEW_ID);
    rebaseInteractiveView = TestUtil.showView(RebaseInteractiveView.VIEW_ID);
    repoView = TestUtil.showView(RepositoriesView.VIEW_ID);
    RepositoriesView repos = (RepositoriesView) repoView.getViewReference().getView(false);
    repos.setReactOnSelection(true);
    historyView = TestUtil.showHistoryView();
    IHistoryView history = (IHistoryView) historyView.getViewReference().getView(false);
    ((GenericHistoryView) history).setLinkingEnabled(true);
    // Ensure that the git history page is active
    Exception[] exception = { null };
    PlatformUI.getWorkbench().getDisplay().syncExec(() -> {
        try {
            history.showHistoryFor(new RepositoryNode(null, lookupRepository(localRepositoryDir)), true);
        } catch (Exception e) {
            exception[0] = e;
        }
    });
    if (exception[0] != null) {
        throw exception[0];
    }
    waitForRefreshes();
}
Also used : URIish(org.eclipse.jgit.transport.URIish) GenericHistoryView(org.eclipse.team.internal.ui.history.GenericHistoryView) RepositoriesView(org.eclipse.egit.ui.internal.repository.RepositoriesView) RepositoryNode(org.eclipse.egit.ui.internal.repository.tree.RepositoryNode) File(java.io.File) IHistoryView(org.eclipse.team.ui.history.IHistoryView) CloneOperation(org.eclipse.egit.core.op.CloneOperation) RepositoryUtil(org.eclipse.egit.core.RepositoryUtil) Before(org.junit.Before)

Example 2 with GenericHistoryView

use of org.eclipse.team.internal.ui.history.GenericHistoryView in project egit by eclipse.

the class SelectionForViewsTest method after.

@After
public void after() {
    RepositoriesView repos = (RepositoriesView) repoView.getViewReference().getView(false);
    repos.setReactOnSelection(false);
    IHistoryView history = (IHistoryView) historyView.getViewReference().getView(false);
    ((GenericHistoryView) history).setLinkingEnabled(false);
    stagingView = null;
    reflogView = null;
    rebaseInteractiveView = null;
    historyView = null;
    repoView = null;
}
Also used : GenericHistoryView(org.eclipse.team.internal.ui.history.GenericHistoryView) RepositoriesView(org.eclipse.egit.ui.internal.repository.RepositoriesView) IHistoryView(org.eclipse.team.ui.history.IHistoryView) After(org.junit.After)

Aggregations

RepositoriesView (org.eclipse.egit.ui.internal.repository.RepositoriesView)2 GenericHistoryView (org.eclipse.team.internal.ui.history.GenericHistoryView)2 IHistoryView (org.eclipse.team.ui.history.IHistoryView)2 File (java.io.File)1 RepositoryUtil (org.eclipse.egit.core.RepositoryUtil)1 CloneOperation (org.eclipse.egit.core.op.CloneOperation)1 RepositoryNode (org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)1 URIish (org.eclipse.jgit.transport.URIish)1 After (org.junit.After)1 Before (org.junit.Before)1