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 int
private static final int
private static final int
private static final int
private static final int
private static final int
private int
private static final int
private final DateRevQueue
private static final int
private int
private int
private LinkedList
<RevCommit> private MergeBaseGenerator.CarryStack
private final RevWalk
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
_next()
private void
private void
carryOntoHistory
(RevCommit c, int carry) private void
carryOntoHistoryInnerLoop
(RevCommit c, int carry) private int
carryOntoOne
(RevCommit p, int carry) (package private) void
(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.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: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
-
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
-
carryOntoHistory
-
carryOntoHistoryInnerLoop
-
carryOntoOne
-