Package org.eclipse.egit.ui.internal.commit

Examples of org.eclipse.egit.ui.internal.commit.RepositoryCommit


    if (repo == null)
      return null;

    List<RepositoryCommit> repositoryCommits = new ArrayList<RepositoryCommit>();
    for (RevCommit commit : commits)
      repositoryCommits.add(new RepositoryCommit(repo, commit));

    final IStructuredSelection selected = new StructuredSelection(
        repositoryCommits);
    CommonUtils
        .runCommand(
View Full Code Here


    BasicConfigurationDialog.show(repo);

    List<RepositoryCommit> repositoryCommits = new ArrayList<RepositoryCommit>();
    for (RevCommit commit : commits)
      repositoryCommits.add(new RepositoryCommit(repo, commit));
    final IStructuredSelection selected = new StructuredSelection(
        repositoryCommits);
    CommonUtils
        .runCommand(
            org.eclipse.egit.ui.internal.commit.command.RevertHandler.ID,
View Full Code Here

          UIText.SquashHandler_ErrorCheckingIfCommitsAreOnCurrentBranch, e);
    }

    List<RepositoryCommit> repositoryCommits = new ArrayList<RepositoryCommit>();
    for (RevCommit commit : commits)
      repositoryCommits.add(new RepositoryCommit(repository, commit));

    final IStructuredSelection selected = new StructuredSelection(
        repositoryCommits);
    CommonUtils.runCommand(
        org.eclipse.egit.ui.internal.commit.command.SquashHandler.ID,
View Full Code Here

          UIText.RewordHandler_ErrorCheckingIfCommitIsOnCurrentBranch,
          e);
    }

    final IStructuredSelection selected = new StructuredSelection(
        new RepositoryCommit(repository, commit));
    CommonUtils
        .runCommand(
            org.eclipse.egit.ui.internal.commit.command.RewordHandler.ID,
            selected);
View Full Code Here

          UIText.EditHandler_ErrorCheckingIfCommitIsOnCurrentBranch,
          e);
    }

    final IStructuredSelection selected = new StructuredSelection(
        new RepositoryCommit(repository, commit));
    CommonUtils.runCommand(
        org.eclipse.egit.ui.internal.commit.command.EditHandler.ID,
        selected);
    openStagingAndRebaseInteractiveViews(repository);
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository repository = getRepository(event);
    List<RevCommit> commits = getSelectedCommits(event);
    for (RevCommit commit : commits) {
      try {
        CommitEditor.open(new RepositoryCommit(repository, commit));
      } catch (PartInitException e) {
        Activator.showError("Error opening commit viewer", e); //$NON-NLS-1$
      }
    }
    return null;
View Full Code Here

    if (node instanceof RefNode || node instanceof TagNode)
      return new CheckoutCommand().execute(event);
    if (node instanceof FileNode)
      return new OpenInEditorCommand().execute(event);
    if (node instanceof StashedCommitNode) {
      RepositoryCommit repositoryCommit = new RepositoryCommit(
          node.getRepository(),
          ((StashedCommitNode) node).getObject());
      repositoryCommit.setStash(true);
      CommitEditor.openQuiet(repositoryCommit);
    }

    return null;
  }
View Full Code Here

    assertEquals(1, commitResult.getMatchCount());
    Object[] elements = commitResult.getElements();
    assertNotNull(elements);
    assertEquals(1, elements.length);
    assertTrue(elements[0] instanceof RepositoryCommit);
    RepositoryCommit repoCommit = (RepositoryCommit) elements[0];
    assertEquals(expectedRepository.getDirectory(), repoCommit
        .getRepository().getDirectory());
    assertEquals(expectedCommit, repoCommit.getRevCommit());
  }
View Full Code Here

    memento = XMLMemento.createWriteRoot("test");
  }

  @Test
  public void shouldPersistAndRestoreCommit() {
    RepositoryCommit repositoryCommit = new RepositoryCommit(
        repository, commit);

    new CommitEditorInput(repositoryCommit).saveState(memento);
    IAdaptable restored = new CommitEditorInputFactory()
        .createElement(memento);
View Full Code Here

        isSameCommit(((CommitEditorInput) restored).getCommit()));
  }

  @Test
  public void shouldPersistAndRestoreStashCommit() {
    RepositoryCommit stashCommit = new RepositoryCommit(
        repository, commit);
    stashCommit.setStash(true);

    new CommitEditorInput(stashCommit).saveState(memento);
    IAdaptable restored = new CommitEditorInputFactory()
        .createElement(memento);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.commit.RepositoryCommit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.