Package org.eclipse.jgit.revwalk
Class DepthWalk.ObjectWalk
- java.lang.Object
-
- org.eclipse.jgit.revwalk.RevWalk
-
- org.eclipse.jgit.revwalk.ObjectWalk
-
- org.eclipse.jgit.revwalk.DepthWalk.ObjectWalk
-
- All Implemented Interfaces:
AutoCloseable
,Iterable<RevCommit>
,DepthWalk
- Enclosing interface:
- DepthWalk
public static class DepthWalk.ObjectWalk extends ObjectWalk implements DepthWalk
Subclass of ObjectWalk that performs depth filtering.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.revwalk.ObjectWalk
ObjectWalk.VisitationPolicy
-
Nested classes/interfaces inherited from interface org.eclipse.jgit.revwalk.DepthWalk
DepthWalk.Commit, DepthWalk.ObjectWalk, DepthWalk.RevWalk
-
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.revwalk.ObjectWalk
SIMPLE_VISITATION_POLICY
-
-
Constructor Summary
Constructors Constructor Description ObjectWalk(ObjectReader or, int depth)
ObjectWalk(Repository repo, int depth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RevCommit
createCommit(AnyObjectId id)
Construct a new unparsed commit for the given object.RevFlag
getDeepenNotFlag()
List<ObjectId>
getDeepenNots()
int
getDeepenSince()
int
getDepth()
Get depth to filter to.RevFlag
getReinterestingFlag()
Get flag marking commits that are interesting again.RevFlag
getUnshallowFlag()
Get flag marking commits that should become unshallow.void
markRoot(RevObject o)
Mark a root commit (i.e., one whose depth should be considered 0.)void
markUnshallow(RevObject c)
Mark an element which used to be shallow in the client, but which should now be considered a full commit.-
Methods inherited from class org.eclipse.jgit.revwalk.ObjectWalk
checkConnectivity, createObjectReachabilityChecker, dispose, getObjectFilter, getPathBuffer, getPathHashCode, getPathLength, getPathString, getTreeDepth, markStart, markUninteresting, next, nextObject, reset, setObjectFilter, setVisitationPolicy, skipTree, sort, sort
-
Methods inherited from class org.eclipse.jgit.revwalk.RevWalk
assertNoCommitsMarkedStart, assertNotStarted, assumeShallow, carry, carry, close, createReachabilityChecker, disposeFlag, getMergedInto, getMergedInto, getObjectReader, getRevFilter, getRevSort, getTreeFilter, hasRevSort, isFirstParent, isMergedInto, isMergedIntoAll, isMergedIntoAny, isRetainBody, iterator, lookupAny, lookupBlob, lookupCommit, lookupOrNull, lookupTag, lookupTree, markStart, markStart, markUninteresting, newFlag, parseAny, parseAny, parseBody, parseCommit, parseHeaders, parseTag, parseTree, peel, reset, resetRetain, resetRetain, retainOnReset, retainOnReset, setFirstParent, setRetainBody, setRevFilter, setRewriteParents, setTreeFilter, toObjectWalkWithSameObjects
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ObjectWalk
public ObjectWalk(Repository repo, int depth)
- Parameters:
repo
- Repository to walkdepth
- Maximum depth to return
-
ObjectWalk
public ObjectWalk(ObjectReader or, int depth)
- Parameters:
or
- Object Readerdepth
- Maximum depth to return
-
-
Method Detail
-
markRoot
public void markRoot(RevObject o) throws MissingObjectException, IncorrectObjectTypeException, IOException
Mark a root commit (i.e., one whose depth should be considered 0.)- Parameters:
o
- Commit to mark- Throws:
IOException
IncorrectObjectTypeException
MissingObjectException
-
markUnshallow
public void markUnshallow(RevObject c) throws MissingObjectException, IncorrectObjectTypeException, IOException
Mark an element which used to be shallow in the client, but which should now be considered a full commit. Any ancestors of this commit should be included in the walk, even if they are the ancestor of an uninteresting commit.- Parameters:
c
- Commit to mark- Throws:
MissingObjectException
IncorrectObjectTypeException
IOException
-
createCommit
protected RevCommit createCommit(AnyObjectId id)
Description copied from class:RevWalk
Construct a new unparsed commit for the given object.- Overrides:
createCommit
in classRevWalk
- 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.
-
getDeepenSince
public int getDeepenSince()
- Specified by:
getDeepenSince
in interfaceDepthWalk
- Returns:
- the deepen-since value; if not 0, this walk only returns commits whose commit time is at or after this limit
-
getDeepenNots
public List<ObjectId> getDeepenNots()
- Specified by:
getDeepenNots
in interfaceDepthWalk
- Returns:
- the objects specified by the client using --shallow-exclude
-
getUnshallowFlag
public RevFlag getUnshallowFlag()
Description copied from interface:DepthWalk
Get flag marking commits that should become unshallow.- Specified by:
getUnshallowFlag
in interfaceDepthWalk
- 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 interfaceDepthWalk
- Returns:
- flag marking commits that are interesting again.
-
getDeepenNotFlag
public RevFlag getDeepenNotFlag()
- Specified by:
getDeepenNotFlag
in interfaceDepthWalk
- Returns:
- flag marking commits that are to be excluded because of --shallow-exclude
-
-