Package org.eclipse.egit.core

Examples of org.eclipse.egit.core.EclipseGitProgressTransformer


            throw new CoreException(Status.CANCEL_STATUS);
          IProject[] validProjects = ProjectUtil.getValidOpenProjects(repository);
          PullCommand pull = new Git(repository).pull();
          PullResult pullResult = null;
          try {
            pull.setProgressMonitor(new EclipseGitProgressTransformer(
                new SubProgressMonitor(mymonitor, 1)));
            pull.setTimeout(timeout);
            pull.setCredentialsProvider(credentialsProvider);
            pullResult = pull.call();
            results.put(repository, pullResult);
View Full Code Here


    final IProject[] validProjects = ProjectUtil.getValidOpenProjects(repository);
    IWorkspaceRunnable action = new IWorkspaceRunnable() {
      public void run(IProgressMonitor actMonitor) throws CoreException {
        RebaseCommand cmd = new Git(repository).rebase()
            .setProgressMonitor(
                new EclipseGitProgressTransformer(actMonitor));
        try {
          if (handler != null)
            cmd.runInteractively(handler, true);
          if (operation == Operation.BEGIN) {
            cmd.setPreserveMerges(preserveMerges);
View Full Code Here

      throw new IllegalStateException(CoreText.OperationAlreadyExecuted);

    IProgressMonitor actMonitor = monitor;
    if (actMonitor == null)
      actMonitor = new NullProgressMonitor();
    EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer(
        actMonitor);
    FetchCommand command;
    if (rc == null)
      command = new Git(repository).fetch().setRemote(
          uri.toPrivateString()).setRefSpecs(specs);
View Full Code Here

                CoreText.PushOperation_resultCancelled);
            continue;
          }

          Collection<RemoteRefUpdate> refUpdates = specification.getRefUpdates(uri);
          final EclipseGitProgressTransformer gitSubMonitor = new EclipseGitProgressTransformer(
              subMonitor);

          try {
            Transport transport = Transport.open(localDb, uri);
            transport.setDryRun(dryRun);
            transport.setTimeout(timeout);
            if (credentialsProvider != null)
              transport.setCredentialsProvider(credentialsProvider);
            PushResult result = transport.push(gitSubMonitor, refUpdates, out);

            operationResult.addOperationResult(result.getURI(), result);
            specification.addURIRefUpdates(result.getURI(), result.getRemoteUpdates());
          } catch (JGitInternalException e) {
            String errorMessage = e.getCause() != null ? e
                .getCause().getMessage() : e.getMessage();
            String userMessage = NLS.bind(
                    CoreText.PushOperation_InternalExceptionOccurredMessage,
                    errorMessage);
            handleException(uri, e, userMessage);
          } catch (Exception e) {
            handleException(uri, e, e.getMessage());
          }

          monitor.worked(WORK_UNITS_PER_TRANSPORT);
        } finally {
          // Dirty trick to get things always working.
          subMonitor.beginTask("", WORK_UNITS_PER_TRANSPORT); //$NON-NLS-1$
          subMonitor.done();
          subMonitor.done();
        }
      }
    else {
      final EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer(
          monitor);
      try {
        Iterable<PushResult> results = git.push().setRemote(
            remoteName).setDryRun(dryRun).setTimeout(timeout)
            .setProgressMonitor(gitMonitor).setCredentialsProvider(
View Full Code Here

  private void buildIndexHeadDiffList(IProject[] selectedProjects,
      IProgressMonitor monitor) throws IOException,
      OperationCanceledException {

    monitor.beginTask(UIText.CommitActionHandler_calculatingChanges, 1000);
    EclipseGitProgressTransformer jgitMonitor = new EclipseGitProgressTransformer(
        monitor);
    CountingVisitor counter = new CountingVisitor();
    for (IProject p : selectedProjects) {
      try {
        p.accept(counter);
View Full Code Here

          pm.worked(1);

          SubmoduleUpdateCommand update = git.submoduleUpdate();
          for (String path : paths)
            update.addPath(path);
          update.setProgressMonitor(new EclipseGitProgressTransformer(
              new SubProgressMonitor(pm, 2)));
          updated = update.call();
          pm.worked(1);
          SubProgressMonitor refreshMonitor = new SubProgressMonitor(
              pm, 1);
View Full Code Here

  /**
   * Execute garbage collection
   */
  public void execute(IProgressMonitor monitor) throws CoreException {
    Git git = new Git(repository);
    EclipseGitProgressTransformer pm = new EclipseGitProgressTransformer(
        monitor);
    try {
      git.gc().setProgressMonitor(pm).call();
    } catch (GitAPIException e) {
      throw new CoreException(new Status(IStatus.ERROR,
View Full Code Here

  public void execute(IProgressMonitor monitor) throws CoreException {
    IWorkspaceRunnable action = new IWorkspaceRunnable() {

      public void run(IProgressMonitor pm) throws CoreException {
        final SubmoduleAddCommand add = Git.wrap(repo).submoduleAdd();
        add.setProgressMonitor(new EclipseGitProgressTransformer(pm));
        add.setPath(path);
        add.setURI(uri);
        try {
          Repository subRepo = add.call();
          if (subRepo != null) {
View Full Code Here

    if (pm == null)
      monitor = new NullProgressMonitor();
    else
      monitor = pm;

    EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer(
        monitor);
    Repository repository = null;
    try {
      monitor.beginTask(NLS.bind(CoreText.CloneOperation_title, uri),
          5000);
View Full Code Here

    this.repository = repository;
    this.commit = commit;
  }

  public void execute(IProgressMonitor monitor) throws CoreException {
    EclipseGitProgressTransformer gitMonitor;
    if (monitor == null)
      gitMonitor = new EclipseGitProgressTransformer(
          new NullProgressMonitor());
    else
      gitMonitor = new EclipseGitProgressTransformer(monitor);

    final StringBuilder sb = new StringBuilder();
    final DiffFormatter diffFmt = new DiffFormatter(
        new ByteArrayOutputStream() {
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.EclipseGitProgressTransformer

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.