Package org.eclipse.jgit.diff

Examples of org.eclipse.jgit.diff.DiffAlgorithm


  }

  private static final int minCPUTimerTicks = 10;

  private void testOne(Test test, RawText a, RawText b) {
    final DiffAlgorithm da = test.algorithm.create();
    int cpuTimeChanges = 0;
    int cnt = 0;

    final long startTime = mxBean.getCurrentThreadCpuTime();
    long lastTime = startTime;
    while (cpuTimeChanges < minCPUTimerTicks) {
      da.diff(cmp, a, b);
      cnt++;

      long interimTime = mxBean.getCurrentThreadCpuTime();
      if (interimTime != lastTime) {
        cpuTimeChanges++;
View Full Code Here


  }

  private static final int minCPUTimerTicks = 10;

  private void testOne(Test test, RawText a, RawText b) {
    final DiffAlgorithm da = test.algorithm.create();
    int cpuTimeChanges = 0;
    int cnt = 0;

    final long startTime = mxBean.getCurrentThreadCpuTime();
    long lastTime = startTime;
    while (cpuTimeChanges < minCPUTimerTicks) {
      da.diff(cmp, a, b);
      cnt++;

      long interimTime = mxBean.getCurrentThreadCpuTime();
      if (interimTime != lastTime) {
        cpuTimeChanges++;
View Full Code Here

    public void getHunks() throws IOException {
        // given
        FileDiff fileDiff = new FileDiff();
        fileDiff.a = new RawText("apple\nbanana\ncat\n".getBytes());
        fileDiff.b = new RawText("apple\nbanana\ncorn\n".getBytes());
        DiffAlgorithm diffAlgorithm =
                DiffAlgorithm.getAlgorithm(DiffAlgorithm.SupportedAlgorithm.HISTOGRAM);
        fileDiff.editList = diffAlgorithm.diff(RawTextComparator.DEFAULT, fileDiff.a,
                        fileDiff.b);

        // when
        List<Hunk> hunks = fileDiff.getHunks();
View Full Code Here

      RawText oldText = readText(diffEntry.getOldId(), reader);
      RawText newText = readText(diffEntry.getNewId(), reader);

      StoredConfig config = repository.getConfig();
      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

TOP

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

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.