Package org.eclipse.jgit.diff

Examples of org.eclipse.jgit.diff.HistogramDiff


    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


  /**
   * Creates a new MergeAlgorithm which uses {@link HistogramDiff} as diff
   * algorithm
   */
  public MergeAlgorithm() {
    this(new HistogramDiff());
  }
View Full Code Here

      if (RawText.isBinary(data2))
        return Collections.emptyList();
    } else
      data2 = new byte[0];

    return new HistogramDiff().diff(comparator, //
        data1.length > 0 ? new RawText(data1) : EMPTY_TEXT, //
        data2.length > 0 ? new RawText(data2) : EMPTY_TEXT);
  }
View Full Code Here

      if (RawText.isBinary(data2))
        return Collections.emptyList();
    } else
      data2 = new byte[0];

    return new HistogramDiff().diff(comparator, //
        data1.length > 0 ? new RawText(data1) : EMPTY_TEXT, //
        data2.length > 0 ? new RawText(data2) : EMPTY_TEXT);
  }
View Full Code Here

  /**
   * Creates a new MergeAlgorithm which uses {@link HistogramDiff} as diff
   * algorithm
   */
  public MergeAlgorithm() {
    this(new HistogramDiff());
  }
View Full Code Here

    private String getDiffinGitFormat(String string1, String string2) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        RawText rt1 = new RawText(string1.getBytes());
        RawText rt2 = new RawText(string2.getBytes());
        EditList diffList = new EditList();
        diffList.addAll(new HistogramDiff().diff(RawTextComparator.DEFAULT, rt1, rt2));
        new DiffFormatter(out).format(diffList, rt1, rt2);
        return out.toString();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.diff.HistogramDiff

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.