Class RewriteGenerator
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
,
after they have been fully buffered by AbstractRevQueue
. The full
buffering is necessary to allow the simple loop used within our own
rewrite(RevCommit)
to pull completely through a strand of
RevWalk.REWRITE
colored commits and come up with a simplification
that makes the DAG dense. Not fully buffering the commits first would cause
this loop to abort early, due to commits not being parsed and colored
correctly.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Forcleanup(RevCommit[])
to remove duplicate parents.private static final int
private final Generator
Fields inherited from class org.eclipse.jgit.revwalk.Generator
firstParent, HAS_REWRITE, HAS_UNINTERESTING, NEEDS_REWRITE, SORT_COMMIT_TIME_DESC, SORT_TOPO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RevCommit[]
(package private) RevCommit
next()
Return the next commit to the application, or the next generator.(package private) int
Obtain flags describing the output behavior of this generator.private RevCommit
(package private) void
Connect the supplied queue to this generator's own free list (if any).
-
Field Details
-
REWRITE
private static final int REWRITE- See Also:
-
DUPLICATE
private static final int DUPLICATEForcleanup(RevCommit[])
to remove duplicate parents.- See Also:
-
source
-
-
Constructor Details
-
RewriteGenerator
RewriteGenerator(Generator s)
-
-
Method Details
-
outputType
int outputType()Description copied from class:Generator
Obtain flags describing the output behavior of this generator.- Specified by:
outputType
in classGenerator
- Returns:
- one or more of the constants declared in this class, describing how this generator produces its results.
-
next
Description copied from class:Generator
Return the next commit to the application, or the next generator.- Specified by:
next
in classGenerator
- Returns:
- next available commit; null if no more are to be returned.
- Throws:
MissingObjectException
IncorrectObjectTypeException
IOException
-
rewrite
-
cleanup