Class DepthWalk.RevWalk

java.lang.Object
org.eclipse.jgit.revwalk.RevWalk
org.eclipse.jgit.revwalk.DepthWalk.RevWalk
All Implemented Interfaces:
AutoCloseable, Iterable<RevCommit>, DepthWalk
Enclosing interface:
DepthWalk

public static class DepthWalk.RevWalk extends RevWalk implements DepthWalk
Subclass of RevWalk that performs depth filtering.
  • Constructor Details

    • RevWalk

      public RevWalk(Repository repo, int depth)
      Create RevWalk
      Parameters:
      repo - Repository to walk
      depth - Maximum depth to return
    • RevWalk

      public RevWalk(ObjectReader or, int depth)
      Create RevWalk
      Parameters:
      or - ObjectReader to use
      depth - Maximum depth to return
  • Method Details

    • markRoot

      Mark a root commit (i.e., one whose depth should be considered 0.)
      Parameters:
      c - Commit to mark
      Throws:
      IOException - if an IO error occurred
      IncorrectObjectTypeException - if object has an unexpected type
      MissingObjectException - if object is missing
    • createCommit

      protected RevCommit createCommit(AnyObjectId id)
      Description copied from class: RevWalk
      Construct a new unparsed commit for the given object.
      Overrides:
      createCommit in class RevWalk
      Parameters:
      id - the object this walker requires a commit reference for.
      Returns:
      a new unparsed reference for the object.
    • getDepth

      public int getDepth()
      Description copied from interface: DepthWalk
      Get depth to filter to.
      Specified by:
      getDepth in interface DepthWalk
      Returns:
      Depth to filter to.
    • getDeepenSince

      public int getDeepenSince()
      Description copied from interface: DepthWalk
      Get deepen-since value
      Specified by:
      getDeepenSince in interface DepthWalk
      Returns:
      the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit
    • setDeepenSince

      public void setDeepenSince(int limit)
      Sets the deepen-since value.
      Parameters:
      limit - new deepen-since value
      Since:
      5.2
    • getDeepenNots

      public List<ObjectId> getDeepenNots()
      Description copied from interface: DepthWalk
      Get deepen-not values
      Specified by:
      getDeepenNots in interface DepthWalk
      Returns:
      the objects specified by the client using --shallow-exclude
    • setDeepenNots

      public void setDeepenNots(List<ObjectId> deepenNots)
      Mark objects that the client specified using --shallow-exclude. Objects that are not commits have no effect.
      Parameters:
      deepenNots - specified objects
      Since:
      5.2
    • getUnshallowFlag

      public RevFlag getUnshallowFlag()
      Description copied from interface: DepthWalk
      Get flag marking commits that should become unshallow.
      Specified by:
      getUnshallowFlag in interface DepthWalk
      Returns:
      flag marking commits that should become unshallow.
    • getReinterestingFlag

      public RevFlag getReinterestingFlag()
      Description copied from interface: DepthWalk
      Get flag marking commits that are interesting again.
      Specified by:
      getReinterestingFlag in interface DepthWalk
      Returns:
      flag marking commits that are interesting again.
    • getDeepenNotFlag

      public RevFlag getDeepenNotFlag()
      Description copied from interface: DepthWalk
      Get deepen-not flag
      Specified by:
      getDeepenNotFlag in interface DepthWalk
      Returns:
      flag marking commits that are to be excluded because of --shallow-exclude
    • toObjectWalkWithSameObjects

      public DepthWalk.ObjectWalk toObjectWalkWithSameObjects()
      Convert to ObjectWalk with same objects
      Overrides:
      toObjectWalkWithSameObjects in class RevWalk
      Returns:
      a new walk, using the exact same object pool.
      Since:
      4.5