Examples of RepositoryCommit


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

      public Object[] getElements(Object element) {
        if (getLayout() == FLAG_LAYOUT_TREE) {
          Map<Repository, RepositoryMatch> repos = new HashMap<Repository, RepositoryMatch>();
          for (Object inputElement : getInput().getElements()) {
            RepositoryCommit commit = (RepositoryCommit) inputElement;
            RepositoryMatch match = repos.get(commit
                .getRepository());
            if (match == null) {
              match = new RepositoryMatch(commit.getRepository());
              repos.put(commit.getRepository(), match);
            }
            match.addCommit(commit);
          }
          return repos.values().toArray();
        }
View Full Code Here

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

  public static final String ID = "org.eclipse.egit.ui.commit.ShowInHistory"; //$NON-NLS-1$

  public Object execute(final ExecutionEvent event) throws ExecutionException {
    List<RepositoryCommit> commits = getCommits(event);
    if (commits.size() == 1) {
      RepositoryCommit repoCommit = commits.get(0);

      try {
        IHistoryView view = (IHistoryView) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage()
            .showView(IHistoryView.VIEW_ID);
View Full Code Here

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

        for (RevCommit commit : walk) {
          if (monitor.isCanceled())
            throw new OperationCanceledException();
          for (SearchMatcher matcher : this.matchers)
            if (matcher.matches(pattern, commit)) {
              result.addResult(new RepositoryCommit(repository,
                  commit));
              break;
            }
        }
      }
View Full Code Here

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

            ReflogEntry entry = (ReflogEntry) element;
            ObjectId id = entry.getNewId();
            if (id == null || id.equals(ObjectId.zeroId()))
              id = entry.getOldId();
            if (id != null && !id.equals(ObjectId.zeroId()))
              CommitEditor.openQuiet(new RepositoryCommit(repo,
                  walk.parseCommit(id)), activateOnOpen);
          }
        } catch (IOException e) {
          Activator.logError(UIText.ReflogView_ErrorOnOpenCommit, e);
        } finally {
View Full Code Here

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

  public static final String ID = "org.eclipse.egit.ui.commit.CreateTag"; //$NON-NLS-1$

  public Object execute(ExecutionEvent event) throws ExecutionException {
    List<RepositoryCommit> commits = getCommits(event);
    if (commits.size() == 1) {
      RepositoryCommit commit = commits.get(0);

      Repository repository = commit.getRepository();
      CreateTagDialog dialog = new CreateTagDialog(
          HandlerUtil.getActiveShellChecked(event), commit
              .getRevCommit().getId(), repository);

      if (dialog.open() != Window.OK)
        return null;

      final TagBuilder tag = new TagBuilder();
      PersonIdent personIdent = new PersonIdent(repository);
      String tagName = dialog.getTagName();

      tag.setTag(tagName);
      tag.setTagger(personIdent);
      tag.setMessage(dialog.getTagMessage());
      tag.setObjectId(commit.getRevCommit());

      try {
        new TagOperation(repository, tag,
            dialog.shouldOverWriteTag())
            .execute(new NullProgressMonitor());
View Full Code Here

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

  }

  private void openCommit() {
    try {
      getShell().dispose();
      CommitEditor.open(new RepositoryCommit(revision.getRepository(),
          revision.getCommit()));
    } catch (PartInitException pie) {
      Activator.logError(pie.getLocalizedMessage(), pie);
    }
  }
View Full Code Here

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

      walk.setRetainBody(true);
      walk.markStart(walk.parseCommit(update.getNewObjectId()));
      walk.markUninteresting(walk.parseCommit(end.getObjectId()));
      List<RepositoryCommit> commits = new ArrayList<RepositoryCommit>();
      for (RevCommit commit : walk)
        commits.add(new RepositoryCommit(repo, commit));
      return commits.toArray(new RepositoryCommit[commits.size()]);
    } catch (IOException e) {
      Activator.logError("Error parsing commits from push result", e); //$NON-NLS-1$
      return new RepositoryCommit[0];
    }
View Full Code Here

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

        PlanElement element = (PlanElement) ((IStructuredSelection) event
            .getSelection()).getFirstElement();
        if (element == null)
          return;

        RepositoryCommit commit = loadCommit(element.getCommit());
        if (commit != null)
          CommitEditor.openQuiet(commit);

      }

      private RepositoryCommit loadCommit(
          AbbreviatedObjectId abbreviatedObjectId) {
        if (abbreviatedObjectId != null) {
          RevWalk walk = new RevWalk(
              RebaseInteractiveView.this.currentRepository);
          try {
            Collection<ObjectId> resolved = walk.getObjectReader()
                .resolve(abbreviatedObjectId);
            if (resolved.size() == 1) {
              RevCommit commit = walk.parseCommit(resolved
                  .iterator().next());
              return new RepositoryCommit(
                  RebaseInteractiveView.this.currentRepository,
                  commit);
            }
          } catch (IOException e) {
            return null;
View Full Code Here

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

      headLink.setForeground(JFaceColors.getHyperlinkText(headLink
          .getDisplay()));
      headLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
          RepositoryCommit commit = getCommit(repository, objectId);
          if(commit != null)
            CommitEditor.openQuiet(commit);
        }
      });
    }
View Full Code Here

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

    RevWalk walk = new RevWalk(repository);
    try {
      RevCommit commit = walk.parseCommit(objectId);
      for (RevCommit parent : commit.getParents())
        walk.parseBody(parent);
      return new RepositoryCommit(repository, commit);
    } catch (IOException e) {
      Activator.showError(NLS.bind(
          UIText.GitProjectPropertyPage_UnableToGetCommit,
          objectId.name()), e);
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.