Package org.eclipse.jgit.revwalk
Class MergeBaseGenerator
java.lang.Object
org.eclipse.jgit.revwalk.Generator
org.eclipse.jgit.revwalk.MergeBaseGenerator
Computes the merge base(s) of the starting commits.
This generator is selected if the RevFilter is only
RevFilter.MERGE_BASE.
To compute the merge base we assign a temporary flag to each of the starting commits. The maximum number of starting commits is bounded by the number of free flags available in the RevWalk when the generator is initialized. These flags will be automatically released on the next reset of the RevWalk, but not until then, as they are assigned to commits throughout the history.
Several internal flags are reused here for a different purpose, but this should not have any impact as this generator should be run alone, and without any other generators wrapped around it.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate intprivate static final intprivate final DateRevQueueprivate static final intprivate intprivate intprivate LinkedList<RevCommit>private MergeBaseGenerator.CarryStackprivate final RevWalkFields 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_next()private voidprivate voidcarryOntoHistory(RevCommit c, int carry) private voidcarryOntoHistoryInnerLoop(RevCommit c, int carry) private intcarryOntoOne(RevCommit p, int carry) (package private) void(package private) RevCommitnext()Return the next commit to the application, or the next generator.(package private) intObtain flags describing the output behavior of this generator.Methods inherited from class org.eclipse.jgit.revwalk.Generator
shareFreeList
-
Field Details
-
PARSED
private static final int PARSED- See Also:
-
IN_PENDING
private static final int IN_PENDING- See Also:
-
POPPED
private static final int POPPED- See Also:
-
MERGE_BASE
private static final int MERGE_BASE- See Also:
-
walker
-
pending
-
branchMask
private int branchMask -
recarryTest
private int recarryTest -
recarryMask
private int recarryMask -
mergeBaseAncestor
private int mergeBaseAncestor -
ret
-
stack
-
CONTINUE
private static final int CONTINUE- See Also:
-
HAVE_ALL
private static final int HAVE_ALL- See Also:
-
CONTINUE_ON_STACK
private static final int CONTINUE_ON_STACK- See Also:
-
-
Constructor Details
-
MergeBaseGenerator
MergeBaseGenerator(RevWalk w)
-
-
Method Details
-
init
- Throws:
IOException
-
add
-
outputType
int outputType()Description copied from class:GeneratorObtain flags describing the output behavior of this generator.- Specified by:
outputTypein classGenerator- Returns:
- one or more of the constants declared in this class, describing how this generator produces its results.
-
_next
-
next
Description copied from class:GeneratorReturn the next commit to the application, or the next generator.- Specified by:
nextin classGenerator- Returns:
- next available commit; null if no more are to be returned.
- Throws:
MissingObjectExceptionIncorrectObjectTypeExceptionIOException
-
carryOntoHistory
-
carryOntoHistoryInnerLoop
-
carryOntoOne
-