Top Description Fields Constructors Methods
org.eclipse.jgit.revwalk

pack-priv Class RewriteGenerator

extends Generator
Class Inheritance
Imports
java.io.IOException, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException

Replaces a RevCommit's parents until not colored with REWRITE.

Before a RevCommit is returned to the caller its parents are updated to create a dense DAG. Instead of reporting the actual parents as recorded when the commit was created the returned commit will reflect the next closest commit that matched the revision walker's filters.

This generator is the second phase of a path limited revision walk and assumes it is receiving RevCommits from TreeRevFilter.

See Also
TreeRevFilter

Field Summary

Modifier and TypeField and Description
private static final int
DUPLICATE

For cleanup(RevCommit[]) to remove duplicate parents.

private final FIFORevQueue
private static final int
private final Generator
Inherited from org.eclipse.jgit.revwalk.Generator:
firstParentHAS_REWRITEHAS_UNINTERESTINGNEEDS_REWRITESORT_COMMIT_TIME_DESCSORT_TOPO

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
applyFilterToParents(RevCommit
given commit
c
)

Makes sure that the TreeRevFilter has been applied to all parents of this commit by the previous PendingGenerator.

private RevCommit[]
cleanup(RevCommit[] oldList)

pack-priv RevCommit
next()

Implements abstract org.eclipse.jgit.revwalk.Generator.next.

Return the next commit to the application, or the next generator.

pack-priv int
outputType()

Implements abstract org.eclipse.jgit.revwalk.Generator.outputType.

Obtain flags describing the output behavior of this generator.

private RevCommit
pack-priv void
shareFreeList(BlockRevQueue
another FIFO queue that wants to share our queue's free list.
q
)

Overrides org.eclipse.jgit.revwalk.Generator.shareFreeList.

Connect the supplied queue to this generator's own free list (if any).

Field Detail

DUPLICATEback to summary
private static final int DUPLICATE

For cleanup(RevCommit[]) to remove duplicate parents.

pendingback to summary
private final FIFORevQueue pending
REWRITEback to summary
private static final int REWRITE
sourceback to summary
private final Generator source

Constructor Detail

RewriteGeneratorback to summary
pack-priv RewriteGenerator(Generator s)

Method Detail

applyFilterToParentsback to summary
private void applyFilterToParents(RevCommit c) throws MissingObjectException, IncorrectObjectTypeException, IOException

Makes sure that the TreeRevFilter has been applied to all parents of this commit by the previous PendingGenerator.

Parameters
c:RevCommit

given commit

Exceptions
MissingObjectException:
if an object is missing
IncorrectObjectTypeException:
if an object has an unexpected type
IOException:
if an IO error occurred
cleanupback to summary
private RevCommit[] cleanup(RevCommit[] oldList)
nextback to summary
pack-priv RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException

Implements abstract org.eclipse.jgit.revwalk.Generator.next.

Doc from org.eclipse.jgit.revwalk.Generator.next.

Return the next commit to the application, or the next generator.

Returns:RevCommit

next available commit; null if no more are to be returned.

Annotations
@SuppressWarnings:ReferenceEquality
@Override
Exceptions
MissingObjectException:
if an object is missing
IncorrectObjectTypeException:
if an object has an unexpected type
IOException:
if an IO error occurred
outputTypeback to summary
pack-priv int outputType()

Implements abstract org.eclipse.jgit.revwalk.Generator.outputType.

Doc from org.eclipse.jgit.revwalk.Generator.outputType.

Obtain flags describing the output behavior of this generator.

Returns:int

one or more of the constants declared in this class, describing how this generator produces its results.

Annotations
@Override
rewriteback to summary
private RevCommit rewrite(RevCommit p) throws MissingObjectException, IncorrectObjectTypeException, IOException
shareFreeListback to summary
pack-priv void shareFreeList(BlockRevQueue q)

Overrides org.eclipse.jgit.revwalk.Generator.shareFreeList.

Doc from org.eclipse.jgit.revwalk.Generator.shareFreeList.

Connect the supplied queue to this generator's own free list (if any).

Parameters
q:BlockRevQueue

another FIFO queue that wants to share our queue's free list.

Annotations
@Override