Examples of CheckOutCommand


Examples of org.eclipse.jgit.api.CheckoutCommand

   public static Ref checkout(final Git git, final String remote, final boolean createBranch,
            final SetupUpstreamMode mode, final boolean force)
            throws GitAPIException
   {
      CheckoutCommand checkout = git.checkout();
      checkout.setCreateBranch(createBranch);
      checkout.setName(remote);
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }
View Full Code Here

Examples of org.eclipse.jgit.api.CheckoutCommand

   public static Ref checkout(final Git git, final Ref localRef, final boolean createBranch,
            final SetupUpstreamMode mode, final boolean force)
            throws GitAPIException
   {
      CheckoutCommand checkout = git.checkout();
      checkout.setName(Repository.shortenRefName(localRef.getName()));
      checkout.setForce(force);
      checkout.setUpstreamMode(mode);
      return checkout.call();
   }
View Full Code Here

Examples of org.eclipse.jgit.api.CheckoutCommand

            project.close(closeMonitor);
          }
          closeMonitor.done();
        }

        CheckoutCommand co = new Git(repository).checkout();
        co.setName(target);

        try {
          co.call();
        } catch (CheckoutConflictException e) {
          return;
        } catch (JGitInternalException e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
        } catch (GitAPIException e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
        } finally {
          BranchOperation.this.result = co.getResult();
        }
        if (result.getStatus() == Status.NONDELETED)
          retryDelete(result.getUndeletedList());
        pm.worked(1);

        List<String> pathsToHandle = new ArrayList<String>();
        pathsToHandle.addAll(co.getResult().getModifiedList());
        pathsToHandle.addAll(co.getResult().getRemovedList());
        pathsToHandle.addAll(co.getResult().getConflictList());
        IProject[] refreshProjects = ProjectUtil
            .getProjectsContaining(repository, pathsToHandle);
        ProjectUtil.refreshValidProjects(refreshProjects, delete,
            new SubProgressMonitor(pm, 1));
        pm.worked(1);
View Full Code Here

Examples of org.eclipse.jgit.api.CheckoutCommand

    CreateLocalBranchOperation bop = new CreateLocalBranchOperation(
        repository, textForBranch, commit);
    bop.execute(monitor);

    if (doCheckout) {
      CheckoutCommand co = new Git(repository).checkout();
      try {
        co.setName(textForBranch).call();
      } catch (CheckoutConflictException e) {
        final CheckoutResult result = co.getResult();

        if (result.getStatus() == Status.CONFLICTS) {
          final Shell shell = getWizard().getContainer().getShell();

          shell.getDisplay().asyncExec(new Runnable() {
View Full Code Here

Examples of org.eclipse.jgit.api.CheckoutCommand

        .splitResourcesByRepository(files);
    for (Entry<Repository, Collection<String>> entry : pathsByRepository.entrySet()) {
      Repository repository = entry.getKey();
      ResourceUtil.saveLocalHistory(repository);
      Collection<String> paths = entry.getValue();
      CheckoutCommand checkoutCommand = new Git(repository).checkout();
      checkoutCommand.setStartPoint(this.revision);
      if (paths.isEmpty() || paths.contains("")) //$NON-NLS-1$
        checkoutCommand.setAllPaths(true);
      else
        for (String path : paths)
          checkoutCommand.addPath(path);
      checkoutCommand.call();
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.api.CheckoutCommand

  }

  private void replaceWith(String[] files, boolean headRevision) {
    if (files == null || files.length == 0)
      return;
    CheckoutCommand checkoutCommand = new Git(currentRepository).checkout();
    if (headRevision)
      checkoutCommand.setStartPoint(Constants.HEAD);
    for (String path : files)
      checkoutCommand.addPath(path);
    try {
      checkoutCommand.call();
    } catch (Exception e) {
      Activator.handleError(UIText.StagingView_checkoutFailed, e, true);
    }
  }
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.command.deltav.CheckOutCommand

      Session session;
      try
      {
         session = session(repoName, workspaceName(repoPath), lockTokens(lockTokenHeader, ifHeader));
         return new CheckOutCommand().checkout(session, path(repoPath));
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.command.deltav.CheckOutCommand

      Session session;
      try
      {
         session = session(repoName, workspaceName(repoPath), lockTokens(lockTokenHeader, ifHeader));
         return new CheckOutCommand().checkout(session, path(repoPath));
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.command.deltav.CheckOutCommand

      Session session;
      try
      {
         session = session(repoName, workspaceName(repoPath), lockTokens(lockTokenHeader, ifHeader));
         return new CheckOutCommand().checkout(session, path(repoPath));
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.command.deltav.CheckOutCommand

      Session session;
      try
      {
         session = session(repoName, workspaceName(repoPath), lockTokens(lockTokenHeader, ifHeader));
         return new CheckOutCommand().checkout(session, path(repoPath));
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
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.