Package org.eclipse.jgit.diff

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


          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


        ObjectId parentId;
        if (parents.length > 0)
          parentId = parents[0].getId();
        else
          parentId = null;
        List<DiffEntry> diffs = diffFmt.scan(parentId, commit.getId());
        for (DiffEntry ent : diffs) {
          String path;
          if (ChangeType.DELETE.equals(ent.getChangeType()))
            path = ent.getOldPath();
          else
View Full Code Here

      }

      diffFmt.setPathFilter(pathFilter);

      if (showNameAndStatusOnly) {
        return diffFmt.scan(oldTree, newTree);
      } else {
        // TODO: not implemented yet
        throw new UnsupportedOperationException();
      }
    } finally {
View Full Code Here

                RevCommit parent = rw.parseCommit(commit.getParent(0).getId());
                DiffFormatter df = new DiffFormatter(NullOutputStream.INSTANCE);
                df.setRepository(repository);
                df.setDiffComparator(RawTextComparator.DEFAULT);
                df.setDetectRenames(true);
                List<DiffEntry> diffs = df.scan(parent.getTree(), commit.getTree());
                for (DiffEntry diff : diffs) {

                    if (diff.getChangeType().equals(DiffEntry.ChangeType.DELETE)) {
                        list.add(diff.getOldPath());
                    } else if (diff.getChangeType().equals(DiffEntry.ChangeType.RENAME)) {
View Full Code Here

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

            List<DiffEntry> diffEntries = formatter.scan(baseTree, commitTree);
            if (blobPath != null && blobPath.length() > 0) {
                for (DiffEntry diffEntry : diffEntries) {
                    if (diffEntry.getNewPath().equalsIgnoreCase(blobPath)) {
                        formatter.format(diffEntry);
                        break;
View Full Code Here

                    RevCommit parent = rw.parseCommit(commit.getParent(0).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) {
                        String objectId = diff.getNewId().name();
                        if (diff.getChangeType().equals(ChangeType.DELETE)) {
                            list.add(new CommitTreeInfo(diff.getOldPath(), diff.getOldPath(), 0, diff
                                    .getNewMode().getBits(), objectId, commit.getId().getName(), diff
View Full Code Here

                }
            }

            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

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.