class RewriteGenerator extends Generator
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.
TreeRevFilter
Modifier and Type | Field and Description |
---|---|
private static int |
DUPLICATE
For
cleanup(RevCommit[]) to remove duplicate parents. |
private static int |
REWRITE |
private Generator |
source |
HAS_REWRITE, HAS_UNINTERESTING, NEEDS_REWRITE, SORT_COMMIT_TIME_DESC, SORT_TOPO
Constructor and Description |
---|
RewriteGenerator(Generator s) |
Modifier and Type | Method and Description |
---|---|
private RevCommit[] |
cleanup(RevCommit[] oldList) |
(package private) RevCommit |
next()
Return the next commit to the application, or the next generator.
|
(package private) int |
outputType()
Obtain flags describing the output behavior of this generator.
|
private RevCommit |
rewrite(RevCommit p) |
(package private) void |
shareFreeList(BlockRevQueue q)
Connect the supplied queue to this generator's own free list (if any).
|
private static final int REWRITE
private static final int DUPLICATE
cleanup(RevCommit[])
to remove duplicate parents.private final Generator source
RewriteGenerator(Generator s)
void shareFreeList(BlockRevQueue q)
Generator
shareFreeList
in class Generator
q
- another FIFO queue that wants to share our queue's free list.int outputType()
Generator
outputType
in class Generator
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
Generator
next
in class Generator
MissingObjectException
IncorrectObjectTypeException
java.io.IOException