Package org.eclipse.jgit.revplot

Examples of org.eclipse.jgit.revplot.PlotCommit


  void selectCommit(final RevCommit c) {
    if (c instanceof PlotCommit)
      table.setSelection(new StructuredSelection(c), true);
    else if (commitsMap != null) {
      PlotCommit swtCommit = commitsMap.get(c.getId().name());
      if (swtCommit == null && tableLoader != null)
        tableLoader.loadCommit(c);
      if (swtCommit != null)
        table.setSelection(new StructuredSelection(swtCommit), true);
    }
View Full Code Here


      return;
    final IStructuredSelection iss = (IStructuredSelection) s;
    final Iterator<PlotCommit> itr = iss.iterator();
    final StringBuilder r = new StringBuilder();
    while (itr.hasNext()) {
      final PlotCommit d = itr.next();
      if (r.length() > 0)
        r.append(LINESEP);
      r.append(d.getId().name());
    }

    if (clipboard == null || clipboard.isDisposed())
      return;
    clipboard.setContents(new Object[] { r.toString() },
View Full Code Here

    return repository.getRepositoryState().equals(RepositoryState.SAFE);
  }

  public Object execute(ExecutionEvent event) throws ExecutionException {

    PlotCommit commit = (PlotCommit) getSelection(event).getFirstElement();
    final Repository repository = getRepository(event);
    if (repository == null)
      return null;

    String currentBranch = getCurrentBranch(repository);
View Full Code Here

    IWizard wiz = null;
    List<Ref> branches = getBranches(selection, repo);

    if (branches.isEmpty()) {
      PlotCommit commit = (PlotCommit) selection
          .getFirstElement();
      wiz = new CreateBranchWizard(repo, commit.name());
    } else {
      // prefer to create new branch based on a remote tracking branch
      Collections.sort(branches, new Comparator<Ref>() {

        public int compare(Ref o1, Ref o2) {
View Full Code Here

    return repository.getRepositoryState().equals(RepositoryState.SAFE);
  }

  public Object execute(ExecutionEvent event) throws ExecutionException {

    PlotCommit commit = (PlotCommit) getSelection(event).getFirstElement();
    final Repository repository = getRepository(event);
    if (repository == null)
      return null;

    String currentBranch = getCurrentBranch(repository);
View Full Code Here

      String head,
      boolean hideCurrentBranch) {
    final List<Ref> branchesOfCommit = new ArrayList<Ref>();
    if (selection.isEmpty())
      return branchesOfCommit;
    PlotCommit commit = (PlotCommit) selection.getFirstElement();

    int refCount = commit.getRefCount();
    for (int i = 0; i < refCount; i++) {
      Ref ref = commit.getRef(i);
      String refName = ref.getName();
      if (hideCurrentBranch && head != null && refName.equals(head))
        continue;
      if (refName.startsWith(Constants.R_HEADS)
          || refName.startsWith(Constants.R_REMOTES))
View Full Code Here

/**
* Command handler to enable pushing commits from the Git History View
*/
public class PushCommitHandler extends AbstractHistoryCommandHandler {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    PlotCommit commit = (PlotCommit) getSelection(event).getFirstElement();
    final Repository repo = getRepository(event);

    try {
      PushBranchWizard wizard = null;
      Ref localBranch = null;
      for (int i = 0; i < commit.getRefCount(); i++) {
        Ref currentRef = commit.getRef(i);
        if (localBranch == null
            && currentRef.getName().startsWith(Constants.R_HEADS))
          localBranch = currentRef;
      }
      if (localBranch == null)
        wizard = new PushBranchWizard(repo, commit.getId());
      else
        wizard = new PushBranchWizard(repo, localBranch);
      WizardDialog dlg = new WizardDialog(
          HandlerUtil.getActiveShellChecked(event),
          wizard);
View Full Code Here

  private List<Ref> getTagsOfCommit(IStructuredSelection selection) {
    final List<Ref> tagsOfCommit = new ArrayList<Ref>();
    if (selection.isEmpty())
      return tagsOfCommit;
    PlotCommit commit = (PlotCommit) selection.getFirstElement();
    for (int i = 0; i < commit.getRefCount(); i++) {
      Ref ref = commit.getRef(i);
      if (ref.getName().startsWith(Constants.R_TAGS))
        tagsOfCommit.add(ref);
    }
    return tagsOfCommit;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.revplot.PlotCommit

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.