A RevWalk instance can only be used once to generate results. Running a
second time requires creating a new RevWalk instance, or invoking
reset() before starting again. Resetting an existing instance may be
faster for some applications as commit body parsing can be avoided on the
later invocations.
RevWalk instances are not thread-safe. Applications must either restrict usage of a RevWalk instance to a single thread, or implement their own synchronization at a higher level.
Multiple simultaneous RevWalk instances per
org. are permitted, even from concurrent
threads. Equality of org.s from two
different RevWalk instances is never true, even if their
org.s are equal (and thus they describe the
same commit).
The offered iterator is over the list of RevCommits described by the
configuration of this instance. Applications should restrict themselves to
using either the provided Iterator or next(), but never use both on
the same RevWalk at the same time. The Iterator may buffer RevCommits, while
next() does not.
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv int | |
| private final boolean | |
| private CommitGraph | |
| private int | |
| private RevFilter | |
| private boolean | |
| pack-priv int | |
| pack-priv final MutableObjectId | |
| private static final int | |
| pack-priv ObjectIdOwnerMap | |
| pack-priv static final int | PARSED
Set on objects whose important header data has been loaded. |
| pack-priv Generator | |
| pack-priv AbstractRevQueue | |
| pack-priv final ObjectReader | |
| pack-priv static final int | RESERVED_FLAGS
Number of flag bits we keep internal for our own use. |
| private boolean | |
| private int | |
| pack-priv static final int | REWRITE
Set on a RevCommit that can collapse out of the history. |
| private boolean | |
| pack-priv final ArrayList | |
| pack-priv static final int | |
| pack-priv boolean | |
| private final EnumSet | |
| pack-priv static final int | TEMP_MARK
Temporary mark for use within generators or filters. |
| pack-priv static final int | TOPO_DELAY
Temporary mark for use within |
| pack-priv static final int | TOPO_QUEUED
Temporary mark for use within |
| pack-priv static final int | TREE_REV_FILTER_APPLIED
Set on a RevCommit when a |
| private TreeFilter | |
| pack-priv static final int | UNINTERESTING
Set on RevCommit instances the caller does not want output. |
| Access | Constructor and Description |
|---|---|
| public | RevWalk(Repository
the repository the walker will obtain data from. An
ObjectReader will be created by the walker, and will be closed
when the walker is closed. repo)Create a new revision walker for a given repository. |
| public | RevWalk(ObjectReader
the reader the walker will obtain data from. The reader is not
closed when the walker is closed (but is closed by
or)dispose().Create a new revision walker for a given repository. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | |
| protected void | |
| protected void | |
| public void | assumeShallow(Collection<? extends ObjectId>
commits that should be treated as shallow commits, in addition
to any commits already known to be shallow by the repository. ids)Assume additional commits are shallow (have no parents). |
| public void | |
| public void | carry(Collection<RevFlag>
the flags to carry onto parents, if set on a descendant. set)Automatically carry flags from a child commit to its parents. |
| pack-priv void | |
| public void | close()
Implements java. Closes this resource, relinquishing any underlying resources. |
| pack-priv CommitGraph | |
| protected RevCommit | Returns: a new unparsed reference for the object.the object this walker requires a commit reference for. id)Construct a new unparsed commit for the given object. |
| private RevCommit | |
| public void | |
| public void | |
| private void | |
| pack-priv void | |
| pack-priv byte[] | |
| pack-priv byte[] | |
| private Set | getCommitsMergedInto(RevCommit needle, Collection<RevCommit> haystacks, Enum<E extends Enum<E>> returnStrategy, ProgressMonitor monitor)
|
| public List | Returns: list of refs that are reachable fromcommit.commit the caller thinks is reachable from commit, Collection<Ref> refs.refs to start iteration from, and which is most likely a
descendant (child) of refs)commit.Determine the Refs into which a commit is merged. |
| public List | Returns: list of refs that are reachable fromcommit.commit the caller thinks is reachable from commit, Collection<Ref> refs.refs to start iteration from, and which is most likely a
descendant (child) of refs, ProgressMonitor commit.the callback for progress and cancellation monitor)Determine the Refs into which a commit is merged. |
| private List | getMergedInto(RevCommit needle, Collection<Ref> haystacks, Enum<E extends Enum<E>> returnStrategy, ProgressMonitor monitor)
|
| public ObjectReader | Returns: the reader this walker is using to load objects.Get the reader this walker is using to load objects. |
| public RevFilter | Returns: the current filter. Never null as a filter is always needed.Get the currently configured commit filter. |
| public EnumSet | Returns: the sorting strategies employed. At least one strategy is always used, but that strategy may beorg..Obtain the sort types applied to the commits returned. |
| pack-priv boolean | |
| public TreeFilter | Returns: the current filter. Never null as a filter is always needed. If no filter is being appliedorg. is
returned.Get the tree filter used to simplify commits by modified paths. |
| public boolean | Returns: true if this strategy is enabled, false otherwisea sorting strategy to look for. sort)Check whether the provided sorting strategy is enabled. |
| pack-priv void | initializeShallowCommits(RevCommit
the initial commit being parsed rc)Reads the "shallow" file and applies it by setting the parents of shallow commits to an empty array. |
| public boolean | Returns: whether only first-parent links should be followed when walking.Whether only first-parent links should be followed when walking |
| public boolean | Returns: true if there is a path directly fromtip to
base (and thus base is fully merged
into tip); false otherwise.commit the caller thinks is reachable from base, RevCommit tip.commit to start iteration from, and which is most likely a
descendant (child) of tip)base.Determine if a commit is reachable from another commit. |
| public boolean | Returns: true if commit is merged into all of the refs; false otherwise.commit the caller thinks is reachable from commit, Collection<Ref> refs.refs to start iteration from, and which is most likely a
descendant (child) of refs)commit.Determine if a |
| public boolean | Returns: true if commit is merged into any of the refs; false otherwise.commit the caller thinks is reachable from commit, Collection<Ref> refs.refs to start iteration from, and which is most likely a
descendant (child) of refs)commit.Determine if a |
| public boolean | Returns: true if commit is merged into any of the revs; false otherwise.commit the caller thinks is reachable from commit, Collection<RevCommit> revs.commits to start iteration from, and which is most likely a
descendant (child) of revs)commit.Determine if a |
| private boolean | |
| public boolean | Returns: true if the body should be retained; false it is discarded.Should the body of a commit or tag be retained after parsing its headers? |
| public Iterator | |
| public RevObject | Returns: reference to the object. Never null.name of the object. id, int type of the object. Must be a valid Git object type. type)Locate a reference to any object without loading it. |
| public RevBlob | Returns: reference to the blob object. Never null.name of the blob object. id)Locate a reference to a blob without loading it. |
| public RevCommit | Returns: reference to the commit object. Never null.name of the commit object. id)Locate a reference to a commit without loading it. |
| protected RevCommit | Returns: reference to the commit object. Never null.name of the commit object. id, int the position in the commit-graph of the object. graphPos)This method is intended to be invoked only by |
| public RevObject | Returns: reference to the object if it has been previously located; otherwise null.name of the object. id)Locate an object that was previously allocated in this walk. |
| public RevTag | Returns: reference to the tag object. Never null.name of the tag object. id)Locate a reference to a tag without loading it. |
| public RevTree | Returns: reference to the tree object. Never null.name of the tree object. id)Locate a reference to a tree without loading it. |
| public void | |
| public void | markStart(Collection<RevCommit>
commits to start traversing from. The commits passed must be
from this same revision walker. list)Mark commits to start graph traversal from. |
| public void | markUninteresting(RevCommit
the commit to start traversing from. The commit passed must be
from this same revision walker. c)Mark a commit to not produce in the output. |
| pack-priv static AbstractRevQueue | |
| pack-priv static DateRevQueue | |
| public RevFlag | |
| public RevCommit | |
| private RevCommit | Returns: next most recent commit; null if traversal is over.Like |
| public RevObject | Returns: reference to the object. Never null.name of the object. id)Locate a reference to any object and immediately parse its headers. |
| public < Type of returned T extends ObjectId> AsyncRevObjectQueueObjectId | Returns: queue to read the objects from.objects to open from the object store. The supplied collection
must not be modified until the queue has finished. objectIds, boolean if true missing objects are reported by calling failure with a
MissingObjectException. This may be more expensive for the
implementation to guarantee. If false the implementation may
choose to report MissingObjectException, or silently skip over
the object with no warning. reportMissing)Asynchronous object parsing. |
| public void | |
| public RevCommit | Returns: reference to the commit object. Never null.name of the commit object. id)Locate a reference to a commit and immediately parse its content. |
| public void | parseHeaders(RevObject
the object the caller needs to be parsed. obj)Ensure the object's critical headers have been parsed. |
| private RevObject | |
| public RevTag | Returns: reference to the tag object. Never null.name of the tag object. id)Locate a reference to an annotated tag and immediately parse its content. |
| public RevTree | Returns: reference to the tree object. Never null.name of the tree object, or a commit or annotated tag that may
reference a tree. id)Locate a reference to a tree. |
| public RevObject | |
| public final void | |
| protected void | reset(int
application flags that should not be cleared from
existing commit objects. retainFlags)Resets internal state and allows this instance to be used again. |
| public final void | resetRetain(RevFlagSet
application flags that should not be cleared from
existing commit objects. retainFlags)Resets internal state and allows this instance to be used again. |
| public final void | resetRetain(RevFlag...
application flags that should not be cleared from
existing commit objects. retainFlags)Resets internal state and allows this instance to be used again. |
| public final void | retainOnReset(RevFlag
the flag to retain during all resets. flag)Preserve a RevFlag during all |
| public final void | retainOnReset(Collection<RevFlag>
the flags to retain during all resets. flags)Preserve a set of RevFlags during all |
| public void | setFirstParent(boolean
true to walk only first-parent links. enable)Set whether or not only first parent links should be followed. |
| public void | setRetainBody(boolean
true to retain bodies; false to discard them early. retain)Set whether or not the body of a commit or tag is retained. |
| public void | setRevFilter(RevFilter
the new filter. If null the special
newFilter)org. filter
will be used instead, as it matches every commit.Set the commit filter for this walker. |
| public void | setRewriteParents(boolean
whether to rewrite parents; defaults to true. rewrite)Set whether to rewrite parent pointers when filtering by modified paths. |
| public void | setTreeFilter(TreeFilter
new filter. If null the special
newFilter)org. filter
will be used instead, as it matches everything.Set the tree filter used to simplify commits by modified paths. |
| public void | |
| public void | |
| public ObjectWalk | Returns: a new walk, using the exact same object pool.Create and return an |
| private static boolean |