Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.CreatePatchOperation.execute()


    try {
      getContainer().run(true, true, new IRunnableWithProgress() {
        public void run(IProgressMonitor monitor)
            throws InvocationTargetException {
          try {
            operation.execute(monitor);

            String content = operation.getPatchContent();
            if (file != null) {
              writeToFile(file, content);
              IFile[] files = ResourcesPlugin.getWorkspace()
View Full Code Here


      CreatePatchOperation operation = new CreatePatchOperation(
          repository, commit);
      operation.setHeaderFormat(DiffHeaderFormat.EMAIL);
      operation.setContextLines(CreatePatchOperation.DEFAULT_CONTEXT_LINES);
      try {
        operation.execute(null);
      } catch (CoreException e) {
        Activator.logError(NLS.bind(
            UIText.CommitGraphTable_UnableToCreatePatch, commit
                .getId().name()), e);
      }
View Full Code Here

        project.getProject(), file, "another line", "2nd commit");

    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), secondCommit);

    operation.execute(new NullProgressMonitor());

    String patchContent = operation.getPatchContent();
    assertNotNull(patchContent);
    assertGitPatch(SIMPLE_GIT_PATCH_CONTENT, patchContent);
View Full Code Here

    // repeat setting the header format explicitly
    operation = new CreatePatchOperation(
        testRepository.getRepository(), secondCommit);

    operation.setHeaderFormat(DiffHeaderFormat.EMAIL);
    operation.execute(new NullProgressMonitor());

    patchContent = operation.getPatchContent();
    assertNotNull(patchContent);
    assertGitPatch(SIMPLE_GIT_PATCH_CONTENT, patchContent);
  }
View Full Code Here

    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), secondCommit);

    operation.setHeaderFormat(DiffHeaderFormat.NONE);
    operation.execute(new NullProgressMonitor());

    String patchContent = operation.getPatchContent();
    assertNotNull(patchContent);
    assertPatch(SIMPLE_PATCH_CONTENT, patchContent);
  }
View Full Code Here

    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), secondCommit);

    operation.setHeaderFormat(DiffHeaderFormat.ONELINE);
    operation.execute(new NullProgressMonitor());

    String patchContent = operation.getPatchContent();
    assertNotNull(patchContent);
    assertPatch(SIMPLE_ONELINE_PATCH_CONTENT, patchContent);
  }
View Full Code Here

  public void testFirstCommit() throws Exception {
    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), commit);

    operation.setHeaderFormat(DiffHeaderFormat.ONELINE);
    operation.execute(null);
    String patchContent = operation.getPatchContent();
    assertPatch("5d67e6eaa2464d15c4216a93a0e7180ec905a2bb new file\n"
        + "diff --git a/test-file b/test-file\n"
        + "new file mode 100644\nindex 0000000..e69de29\n"
        + "--- /dev/null\n" + "+++ b/test-file", patchContent);
View Full Code Here

  public void testNullMonitor() throws Exception {
    RevCommit secondCommit = testRepository.appendContentAndCommit(
        project.getProject(), file, "another line", "2nd commit");
    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), secondCommit);
    operation.execute(null);
  }

  @Test
  public void testSuggestName() throws Exception {
    RevCommit aCommit = testRepository.appendContentAndCommit(
View Full Code Here

    // create patch
    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), commit);

    operation.setHeaderFormat(DiffHeaderFormat.WORKSPACE);
    operation.execute(new NullProgressMonitor());

    assertPatch(SIMPLE_WORKSPACE_PATCH_CONTENT, operation.getPatchContent());
  }

  @Test
View Full Code Here

    // create patch
    CreatePatchOperation operation = new CreatePatchOperation(
        testRepository.getRepository(), null);

    operation.setHeaderFormat(DiffHeaderFormat.WORKSPACE);
    operation.execute(new NullProgressMonitor());

    assertPatch(SIMPLE_WORKSPACE_PATCH_CONTENT, operation.getPatchContent());
  }

  private void assertGitPatch(String expected, String actual) {
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.