Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevWalk.parseTree()


  public List<DiffEntry> scan(AnyObjectId a, AnyObjectId b)
      throws IOException {
    assertHaveRepository();

    RevWalk rw = new RevWalk(reader);
    return scan(rw.parseTree(a), rw.parseTree(b));
  }

  /**
   * Determine the differences between two trees.
   *
 
View Full Code Here


  public boolean inHead(String path) throws IOException {
    ObjectId headId = repository.resolve(Constants.HEAD);
    RevWalk rw = new RevWalk(repository);
    TreeWalk tw = null;
    try {
      tw = TreeWalk.forPath(repository, path, rw.parseTree(headId));
      return tw != null;
    } finally {
      rw.release();
      rw.dispose();
      if (tw != null)
View Full Code Here

        System.out.println("\nPrint contents of tree of head of master branch, i.e. the latest binary tree information");

        // a commit points to a tree
        RevWalk walk = new RevWalk(repository);
        RevCommit commit = walk.parseCommit(head.getObjectId());
        RevTree tree = walk.parseTree(commit.getTree().getId());
        System.out.println("Found Tree: " + tree);
        loader = repository.open(tree.getId());
        loader.copyTo(System.out);

        walk.dispose();
View Full Code Here

            MissingObjectException,
            IncorrectObjectTypeException {
        // from the commit we can build the tree which allows us to construct the TreeParser
        RevWalk walk = new RevWalk(repository);
        RevCommit commit = walk.parseCommit(ObjectId.fromString(objectId));
        RevTree tree = walk.parseTree(commit.getTree().getId());

        CanonicalTreeParser oldTreeParser = new CanonicalTreeParser();
        ObjectReader oldReader = repository.newObjectReader();
        try {
            oldTreeParser.reset(oldReader, tree.getId());
View Full Code Here

      MissingObjectException,
      IncorrectObjectTypeException {
    // from the commit we can build the tree which allows us to construct the TreeParser
    RevWalk walk = new RevWalk(repository);
    RevCommit commit = walk.parseCommit(ObjectId.fromString(objectId));
    RevTree tree = walk.parseTree(commit.getTree().getId());

    CanonicalTreeParser oldTreeParser = new CanonicalTreeParser();
    ObjectReader oldReader = repository.newObjectReader();
    try {
      oldTreeParser.reset(oldReader, tree.getId());
View Full Code Here

        RevCommit commit = walk.parseCommit(head.getObjectId());
        System.out.println("Commit: " + commit);

        // a commit points to a tree
        RevTree tree = walk.parseTree(commit.getTree().getId());
        System.out.println("Found Tree: " + tree);

        walk.dispose();

        repository.close();
View Full Code Here

            IncorrectObjectTypeException {
        // from the commit we can build the tree which allows us to construct the TreeParser
        Ref head = repository.getRef(ref);
        RevWalk walk = new RevWalk(repository);
        RevCommit commit = walk.parseCommit(head.getObjectId());
        RevTree tree = walk.parseTree(commit.getTree().getId());

        CanonicalTreeParser oldTreeParser = new CanonicalTreeParser();
        ObjectReader oldReader = repository.newObjectReader();
        try {
            oldTreeParser.reset(oldReader, tree.getId());
View Full Code Here

  public List<DiffEntry> scan(AnyObjectId a, AnyObjectId b)
      throws IOException {
    assertHaveRepository();

    RevWalk rw = new RevWalk(reader);
    return scan(rw.parseTree(a), rw.parseTree(b));
  }

  /**
   * Determine the differences between two trees.
   *
 
View Full Code Here

  public List<DiffEntry> scan(AnyObjectId a, AnyObjectId b)
      throws IOException {
    assertHaveRepository();

    RevWalk rw = new RevWalk(reader);
    return scan(rw.parseTree(a), rw.parseTree(b));
  }

  /**
   * Determine the differences between two trees.
   *
 
View Full Code Here

    try {
      treeWalk.addTree(new DirCacheIterator(repo.readDirCache()));
      ObjectId headID = repo.resolve(Constants.HEAD);
      if (headID != null) {
        revWalk = new RevWalk(repo);
        treeWalk.addTree(revWalk.parseTree(headID));
        revWalk.dispose();
        revWalk = null;
      }

      treeWalk.setFilter(TreeFilter.ANY_DIFF);
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.