Examples of EditList


Examples of org.eclipse.jgit.diff.EditList

    return split(next, n);
  }

  private boolean split(Candidate parent, Candidate source)
      throws IOException {
    EditList editList = diffAlgorithm.diff(textComparator,
        parent.sourceText, source.sourceText);
    if (editList.isEmpty()) {
      // Ignoring whitespace (or some other special comparator) can
      // cause non-identical blobs to have an empty edit list. In
      // a case like this push the parent alone.
      parent.regionList = source.regionList;
      push(parent);
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

        p.sourceBlob = ids[pIdx];
      } else {
        continue;
      }

      EditList editList;
      if (n instanceof ReverseCandidate
          && p.sourceBlob.equals(n.sourceBlob)) {
        // This special case happens on ReverseCandidate forks.
        p.sourceText = n.sourceText;
        editList = new EditList(0);
      } else {
        p.loadText(reader);
        editList = diffAlgorithm.diff(textComparator,
            p.sourceText, n.sourceText);
      }

      if (editList.isEmpty()) {
        // Ignoring whitespace (or some other special comparator) can
        // cause non-identical blobs to have an empty edit list. In
        // a case like this push the parent alone.
        if (n instanceof ReverseCandidate) {
          parents[pIdx] = p;
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

  }

  /** @return a list describing the content edits performed within the hunk. */
  public EditList toEditList() {
    if (editList == null) {
      editList = new EditList();
      final byte[] buf = file.buf;
      int c = nextLF(buf, startOffset);
      int oLine = old.startLine;
      int nLine = newStartLine;
      Edit in = null;
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

      DiffAlgorithm diffAlgorithm = DiffAlgorithm.getAlgorithm(config
          .getEnum(ConfigConstants.CONFIG_DIFF_SECTION, null,
              ConfigConstants.CONFIG_KEY_ALGORITHM,
              SupportedAlgorithm.HISTOGRAM));

      EditList editList = diffAlgorithm.diff(RawTextComparator.DEFAULT,
          oldText, newText);

      return new Diff(diffEntry.getOldPath(), oldText, newText, editList);
    } catch (IOException e) {
      return null;
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

      d.append("\n"); //$NON-NLS-1$
    }

    final RawText a = getRawText(id1, reader);
    final RawText b = getRawText(id2, reader);
    EditList editList = MyersDiff.INSTANCE
        .diff(RawTextComparator.DEFAULT, a, b);
    diffFmt.format(editList, a, b);
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

  private void createDiffLinkAndText(final RevCommit parent, final Diff diff)
      throws IOException {
    String parentId = parent.toObjectId().abbreviate(7).name();
    String parentMessage = parent.getShortMessage();

    EditList interestingDiff = getInterestingDiff(diff.getEditList());

    final Integer parentLine;
    if (!interestingDiff.isEmpty())
      parentLine = Integer.valueOf(interestingDiff.get(0).getBeginA());
    else
      parentLine = null;

    Composite header = new Composite(diffComposite, SWT.NONE);
    header.setLayout(GridLayoutFactory.fillDefaults().numColumns(2)
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

    if (sourceLine == null)
      // Fall back to whole diff
      return fullDiff;

    int line = sourceLine.intValue();
    EditList interestingDiff = new EditList(1);
    for (Edit edit : fullDiff) {
      if (line >= edit.getBeginB() && line <= edit.getEndB())
        interestingDiff.add(edit);
    }
    return interestingDiff;
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

    return split(next, n);
  }

  private boolean split(Candidate parent, Candidate source)
      throws IOException {
    EditList editList = diffAlgorithm.diff(textComparator,
        parent.sourceText, source.sourceText);
    if (editList.isEmpty()) {
      // Ignoring whitespace (or some other special comparator) can
      // cause non-identical blobs to have an empty edit list. In
      // a case like this push the parent alone.
      parent.regionList = source.regionList;
      push(parent);
View Full Code Here

Examples of org.eclipse.jgit.diff.EditList

        p.sourceBlob = ids[pIdx];
      } else {
        continue;
      }

      EditList editList;
      if (n instanceof ReverseCandidate
          && p.sourceBlob.equals(n.sourceBlob)) {
        // This special case happens on ReverseCandidate forks.
        p.sourceText = n.sourceText;
        editList = new EditList(0);
      } else {
        p.loadText(reader);
        editList = diffAlgorithm.diff(textComparator,
            p.sourceText, n.sourceText);
      }

      if (editList.isEmpty()) {
        // Ignoring whitespace (or some other special comparator) can
        // cause non-identical blobs to have an empty edit list. In
        // a case like this push the parent alone.
        if (n instanceof ReverseCandidate) {
          parents[pIdx] = p;
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.