Package org.eclipse.jgit.diff

Examples of org.eclipse.jgit.diff.DiffFormatter.format()


      List<DiffEntry> result = diffFmt.scan(oldTree, newTree);
      if (showNameAndStatusOnly) {
        return result;
      } else {
        diffFmt.format(result);
        diffFmt.flush();
        return result;
      }
    } finally {
      diffFmt.release();
View Full Code Here


    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
    df.setRepository(repo);
    df.format(commitToPick.getParent(0), commitToPick);
    createFile(rebaseDir, PATCH, new String(bos.toByteArray(),
        Constants.CHARACTER_ENCODING));
    createFile(rebaseDir, STOPPED_SHA, repo.newObjectReader().abbreviate(
        commitToPick).name());
    // Remove cherry pick state file created by CherryPickCommand, it's not
View Full Code Here

    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
    df.setRepository(repo);
    df.format(commitToPick.getParent(0), commitToPick);
    createFile(rebaseDir, PATCH, new String(bos.toByteArray(),
        Constants.CHARACTER_ENCODING));
    createFile(rebaseDir, STOPPED_SHA, repo.newObjectReader().abbreviate(
        commitToPick).name());
    // Remove cherry pick state file created by CherryPickCommand, it's not
View Full Code Here

    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
    df.setRepository(repo);
    df.format(commitToPick.getParent(0), commitToPick);
    createFile(rebaseDir, PATCH, new String(bos.toByteArray(),
        Constants.CHARACTER_ENCODING));
    createFile(rebaseDir, STOPPED_SHA, repo.newObjectReader().abbreviate(
        commitToPick).name());
    // Remove cherry pick state file created by CherryPickCommand, it's not
View Full Code Here

      return "";
    }
    try {
      fmt.setRepository(git);
      fmt.setDetectRenames(true);
      fmt.format(patchList.getOldId(), patchList.getNewId());
      return RawParseUtils.decode(buf.toByteArray());
    } catch (IOException e) {
      if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) {
        return "";
      }
View Full Code Here

            ByteArrayOutputStream diffOutputStream = new ByteArrayOutputStream();
            DiffFormatter diffFormatter = new DiffFormatter(diffOutputStream);
            diffFormatter.setRepository(context.getRepository());
            diffFormatter.setDiffComparator(RawTextComparator.DEFAULT);
            diffFormatter.setDetectRenames(true);
            diffFormatter.format(parentCommit.getTree(),revCommit.getTree());
            return new String(diffOutputStream.toByteArray());
        } else {
            return null;
        }
    }
View Full Code Here

    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
    df.setRepository(repo);
    df.format(commitToPick.getParent(0), commitToPick);
    createFile(rebaseDir, PATCH, new String(bos.toByteArray(),
        Constants.CHARACTER_ENCODING));
    createFile(rebaseDir, STOPPED_SHA, repo.newObjectReader().abbreviate(
        commitToPick).name());
    return new RebaseResult(commitToPick);
View Full Code Here

    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
    df.setRepository(repo);
    df.format(commitToPick.getParent(0), commitToPick);
    createFile(rebaseDir, PATCH, new String(bos.toByteArray(),
        Constants.CHARACTER_ENCODING));
    createFile(rebaseDir, STOPPED_SHA, repo.newObjectReader().abbreviate(
        commitToPick).name());
    // Remove cherry pick state file created by CherryPickCommand, it's not
View Full Code Here

      List<DiffEntry> diffEntries = df.scan(baseTree, commitTree);
      if (path != null && path.length() > 0) {
        for (DiffEntry diffEntry : diffEntries) {
          if (diffEntry.getNewPath().equalsIgnoreCase(path)) {
            df.format(diffEntry);
            break;
          }
        }
      } else {
        df.format(diffEntries);
View Full Code Here

            df.format(diffEntry);
            break;
          }
        }
      } else {
        df.format(diffEntries);
      }
      if (df instanceof GitBlitDiffFormatter) {
        // workaround for complex private methods in DiffFormatter
        diff = ((GitBlitDiffFormatter) df).getHtml();
        stat = ((GitBlitDiffFormatter) df).getDiffStat();
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.