Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.RewordCommitOperation


    String newMessage = promptCommitMessage(shell, commit);
    if (newMessage == null)
      return null;

    final RewordCommitOperation op = new RewordCommitOperation(repo,
        commit, newMessage);

    Job job = new WorkspaceJob(MessageFormat.format(
        UIText.RewordHandler_JobName,
        commit.name())) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          op.execute(monitor);
        } catch (CoreException e) {
          Activator.logError(UIText.RewordHandler_InternalError, e);
        }
        return Status.OK_STATUS;
      }

      @Override
      public boolean belongsTo(Object family) {
        if (JobFamilies.REWORD.equals(family))
          return true;
        return super.belongsTo(family);
      }
    };
    job.setUser(true);
    job.setRule(op.getSchedulingRule());
    job.schedule();
    return null;
  }
View Full Code Here


    super.tearDown();
  }

  @Test
  public void reword() throws Exception {
    RewordCommitOperation op = new RewordCommitOperation(
        testRepository.getRepository(), commit, "new message");
    op.execute(new NullProgressMonitor());

    LogCommand log = new Git(testRepository.getRepository()).log();
    RevCommit newCommit = log.call().iterator().next();
    assertEquals("new message", newCommit.getFullMessage());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.op.RewordCommitOperation

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.