Examples of EditList


Examples of com.google.gerrit.prettify.common.EditList

    final Edit last = edits.get(edits.size() - 1);
    return last.getBeginA() + (b - last.getEndB());
  }

  private void packContent(boolean ignoredWhitespace) {
    EditList list = new EditList(edits, context, a.size(), b.size());
    for (final EditList.Hunk hunk : list.getHunks()) {
      while (hunk.next()) {
        if (hunk.isContextLine()) {
          final String lineA = a.src.getString(hunk.getCurA());
          a.dst.addLine(hunk.getCurA(), lineA);
View Full Code Here

Examples of com.google.gerrit.prettify.common.EditList

  public Iterable<EditList.Hunk> getHunks() {
    int ctx = diffPrefs.getContext();
    if (ctx == AccountDiffPreference.WHOLE_FILE_CONTEXT) {
      ctx = Math.max(a.size(), b.size());
    }
    return new EditList(edits, ctx, a.size(), b.size()).getHunks();
  }
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

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

    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

    Text bText = Text.forCommit(db, reader, bCommit);

    byte[] rawHdr = hdr.toString().getBytes("UTF-8");
    RawText aRawText = new RawText(aText.getContent());
    RawText bRawText = new RawText(bText.getContent());
    EditList edits = new HistogramDiff().diff(cmp, aRawText, bRawText);
    FileHeader fh = new FileHeader(rawHdr, edits, PatchType.UNIFIED);
    return new PatchListEntry(fh, edits);
  }
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.