Package org.eclipse.jgit.diff

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


      if (destinationPrefix != null)
        diffFmt.setNewPrefix(destinationPrefix);
      if (sourcePrefix != null)
        diffFmt.setOldPrefix(sourcePrefix);

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


      DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE);
      df.setRepository(repo);
      df.setDiffComparator(cmp);
      df.setDetectRenames(true);
      List<DiffEntry> diffEntries = df.scan(aTree, bTree);

      final int cnt = diffEntries.size();
      final PatchListEntry[] entries = new PatchListEntry[1 + cnt];
      entries[0] = newCommitMessage(cmp, repo, reader, //
          againstParent ? null : aCommit, b);
View Full Code Here

            RevCommit parent = rw.parseCommit( realParant.getId() );
            DiffFormatter df = new DiffFormatter( DisabledOutputStream.INSTANCE );
            df.setRepository( repository );
            df.setDiffComparator( RawTextComparator.DEFAULT );
            df.setDetectRenames( true );
            List<DiffEntry> diffs = df.scan( parent.getTree(), commit.getTree() );
            for ( DiffEntry diff : diffs )
            {
                list.add( new ScmFile( diff.getNewPath(), ScmFileStatus.CHECKED_IN ) );
            }
            rw.release();
View Full Code Here

      DiffFormatter df = new DiffFormatter(null);
      df.setRepository(repository);
      df.setDiffComparator(RawTextComparator.DEFAULT);
      df.setDetectRenames(true);

      List<DiffEntry> diffEntries = df.scan(startCommit.getTree(), endCommit.getTree());
      for (DiffEntry diff : diffEntries) {
        PathChangeModel pcm = PathChangeModel.from(diff,  endCommit.getName());
        list.add(pcm);
      }
      Collections.sort(list);
View Full Code Here

      DiffFormatter df = new DiffFormatter(null);
      df.setRepository(repository);
      df.setDiffComparator(RawTextComparator.DEFAULT);
      df.setDetectRenames(true);

      List<DiffEntry> diffEntries = df.scan(startCommit.getTree(), endCommit.getTree());
      for (DiffEntry diff : diffEntries) {
        PathChangeModel pcm = PathChangeModel.from(diff,  endCommit.getName());
        list.add(pcm);
      }
      Collections.sort(list);
View Full Code Here

        }
      } else {
        baseTree = baseCommit.getTree();
      }

      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;
View Full Code Here

          newTree = new FileTreeIterator(repo);
      }

      diffFmt.setPathFilter(pathFilter);

      List<DiffEntry> result = diffFmt.scan(oldTree, newTree);
      if (showNameAndStatusOnly)
        return result;
      else {
        if (contextLines >= 0)
          diffFmt.setContext(contextLines);
View Full Code Here

          newTree = new FileTreeIterator(repo);
      }

      diffFmt.setPathFilter(pathFilter);

      List<DiffEntry> result = diffFmt.scan(oldTree, newTree);
      if (showNameAndStatusOnly)
        return result;
      else {
        if (contextLines >= 0)
          diffFmt.setContext(contextLines);
View Full Code Here

          rw = new RevWalk(db);
          diffFormat = new DiffFormatter(NullOutputStream.INSTANCE);
          diffFormat.setRepository(db);
          if (filter != null)
            diffFormat.setPathFilter(filter);
          l = diffFormat.scan(new EmptyTreeIterator(), new CanonicalTreeParser(null, rw.getObjectReader(), revCommit.getTree()));
        } finally {
          diffFormat.release();
          rw.release();
        }
      }
View Full Code Here

            RevCommit parent = rw.parseCommit( realParant.getId() );
            DiffFormatter df = new DiffFormatter( DisabledOutputStream.INSTANCE );
            df.setRepository( repository );
            df.setDiffComparator( RawTextComparator.DEFAULT );
            df.setDetectRenames( true );
            List<DiffEntry> diffs = df.scan( parent.getTree(), commit.getTree() );
            for ( DiffEntry diff : diffs )
            {
                list.add( new ScmFile( diff.getNewPath(), ScmFileStatus.CHECKED_IN ) );
            }
            rw.release();
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.