Examples of RebaseCommand


Examples of com.aragost.javahg.ext.rebase.RebaseCommand

    public final String getCommandName() {
        return "rebase";
    }

    public static RebaseCommand on(Repository repository) {
        return new RebaseCommand(repository);
    }
View Full Code Here

Examples of org.eclipse.jgit.api.RebaseCommand

  private boolean rebase(HttpServletRequest request, HttpServletResponse response, Repository db, String commitToRebase, String rebaseOperation)
      throws ServletException, JSONException, AmbiguousObjectException, IOException {
    JSONObject result = new JSONObject();
    try {
      Git git = new Git(db);
      RebaseCommand rebase = git.rebase();
      Operation operation;
      if (rebaseOperation != null) {
        operation = Operation.valueOf(rebaseOperation);
      } else {
        operation = Operation.BEGIN;
      }
      if (commitToRebase != null && !commitToRebase.isEmpty()) {
        ObjectId objectId = db.resolve(commitToRebase);
        rebase.setUpstream(objectId);
      } else if (operation.equals(Operation.BEGIN)) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST,
            "Missing commit refId.", null));
      }
      rebase.setOperation(operation);
      RebaseResult rebaseResult = rebase.call();
      result.put(GitConstants.KEY_RESULT, rebaseResult.getStatus().name());
    } catch (UnmergedPathsException e) {
      // this error should be handled by client, so return a proper status
      result.put(GitConstants.KEY_RESULT, AdditionalRebaseStatus.FAILED_UNMERGED_PATHS.name());
    } catch (WrongRepositoryStateException e) {
View Full Code Here

Examples of org.eclipse.jgit.api.RebaseCommand

    else
      monitor = m;
    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);
            result = cmd.setUpstream(ref.getName()).call();
          }
          else
            result = cmd.setOperation(operation).call();

        } catch (NoHeadException e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
        } catch (RefNotFoundException e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
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.