Package org.eclipse.jgit.revwalk
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
Subclass of RevWalk that performs depth filtering.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jgit.revwalk.DepthWalk
DepthWalk.Commit, DepthWalk.ObjectWalk, DepthWalk.RevWalk -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RevFlagprivate intprivate final intprivate final RevFlagprivate final RevFlagFields inherited from class org.eclipse.jgit.revwalk.RevWalk
carryFlags, freeFlags, idBuffer, objects, PARSED, pending, queue, reader, RESERVED_FLAGS, REWRITE, roots, SEEN, shallowCommitsInitialized, TEMP_MARK, TOPO_DELAY, TOPO_QUEUED, UNINTERESTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RevCommitConstruct a new unparsed commit for the given object.intintgetDepth()Get depth to filter to.Get flag marking commits that are interesting again.Get flag marking commits that should become unshallow.voidMark a root commit (i.e., one whose depth should be considered 0.)voidsetDeepenNots(List<ObjectId> deepenNots) Mark objects that the client specified using --shallow-exclude.voidsetDeepenSince(int limit) Sets the deepen-since value.Create and return anObjectWalkusing the same objects.Methods inherited from class org.eclipse.jgit.revwalk.RevWalk
allocFlag, assertNoCommitsMarkedStart, assertNotStarted, assumeShallow, carry, carry, carryFlagsImpl, close, createReachabilityChecker, dispose, disposeFlag, freeFlag, getCachedBytes, getCachedBytes, getMergedInto, getMergedInto, getObjectReader, getRevFilter, getRevSort, getRewriteParents, getTreeFilter, hasRevSort, initializeShallowCommits, isFirstParent, isMergedInto, isMergedIntoAll, isMergedIntoAny, isRetainBody, iterator, lookupAny, lookupBlob, lookupCommit, lookupOrNull, lookupTag, lookupTree, markStart, markStart, markUninteresting, newFlag, next, parseAny, parseAny, parseBody, parseCommit, parseHeaders, parseTag, parseTree, peel, reset, reset, resetRetain, resetRetain, retainOnReset, retainOnReset, setFirstParent, setRetainBody, setRevFilter, setRewriteParents, setTreeFilter, sort, sortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
depth
private final int depth -
deepenSince
private int deepenSince -
deepenNots
-
UNSHALLOW
-
REINTERESTING
-
DEEPEN_NOT
-
-
Constructor Details
-
RevWalk
- Parameters:
repo- Repository to walkdepth- Maximum depth to return
-
RevWalk
- Parameters:
or- ObjectReader to usedepth- Maximum depth to return
-
-
Method Details
-
markRoot
public void markRoot(RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException Mark a root commit (i.e., one whose depth should be considered 0.)- Parameters:
c- Commit to mark- Throws:
IOExceptionIncorrectObjectTypeExceptionMissingObjectException
-
createCommit
Description copied from class:RevWalkConstruct a new unparsed commit for the given object.- Overrides:
createCommitin 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:DepthWalkGet depth to filter to. -
getDeepenSince
public int getDeepenSince()- Specified by:
getDeepenSincein interfaceDepthWalk- 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
- Specified by:
getDeepenNotsin interfaceDepthWalk- Returns:
- the objects specified by the client using --shallow-exclude
-
setDeepenNots
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
Description copied from interface:DepthWalkGet flag marking commits that should become unshallow.- Specified by:
getUnshallowFlagin interfaceDepthWalk- Returns:
- flag marking commits that should become unshallow.
-
getReinterestingFlag
Description copied from interface:DepthWalkGet flag marking commits that are interesting again.- Specified by:
getReinterestingFlagin interfaceDepthWalk- Returns:
- flag marking commits that are interesting again.
-
getDeepenNotFlag
- Specified by:
getDeepenNotFlagin interfaceDepthWalk- Returns:
- flag marking commits that are to be excluded because of --shallow-exclude
-
toObjectWalkWithSameObjects
Description copied from class:RevWalkCreate and return anObjectWalkusing the same objects.Prior to using this method, the caller must reset this RevWalk to clean any flags that were used during the last traversal.
The returned ObjectWalk uses the same ObjectReader, internal object pool, and free RevFlags. Once the ObjectWalk is created, this RevWalk should not be used anymore.
- Overrides:
toObjectWalkWithSameObjectsin classRevWalk- Returns:
- a new walk, using the exact same object pool.
- Since:
- 4.5
-