Package org.eclipse.jgit.revwalk
Class MergeBaseGenerator
- java.lang.Object
-
- org.eclipse.jgit.revwalk.Generator
-
- org.eclipse.jgit.revwalk.MergeBaseGenerator
-
class MergeBaseGenerator extends Generator
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 Modifier and Type Class Description private static classMergeBaseGenerator.CarryStack
-
Field Summary
Fields Modifier and Type Field Description private intbranchMaskprivate static intCONTINUEprivate static intCONTINUE_ON_STACKprivate static intHAVE_ALLprivate static intIN_PENDINGprivate static intMERGE_BASEprivate intmergeBaseAncestorprivate static intPARSEDprivate DateRevQueuependingprivate static intPOPPEDprivate intrecarryMaskprivate intrecarryTestprivate java.util.LinkedList<RevCommit>retprivate MergeBaseGenerator.CarryStackstackprivate RevWalkwalker-
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 Constructor Description MergeBaseGenerator(RevWalk w)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private RevCommit_next()private voidadd(RevCommit c)private voidcarryOntoHistory(RevCommit c, int carry)private voidcarryOntoHistoryInnerLoop(RevCommit c, int carry)private intcarryOntoOne(RevCommit p, int carry)(package private) voidinit(AbstractRevQueue p)(package private) RevCommitnext()Return the next commit to the application, or the next generator.(package private) intoutputType()Obtain flags describing the output behavior of this generator.-
Methods inherited from class org.eclipse.jgit.revwalk.Generator
shareFreeList
-
-
-
-
Field Detail
-
PARSED
private static final int PARSED
- See Also:
- Constant Field Values
-
IN_PENDING
private static final int IN_PENDING
- See Also:
- Constant Field Values
-
POPPED
private static final int POPPED
- See Also:
- Constant Field Values
-
MERGE_BASE
private static final int MERGE_BASE
- See Also:
- Constant Field Values
-
walker
private final RevWalk walker
-
pending
private final DateRevQueue pending
-
branchMask
private int branchMask
-
recarryTest
private int recarryTest
-
recarryMask
private int recarryMask
-
mergeBaseAncestor
private int mergeBaseAncestor
-
ret
private java.util.LinkedList<RevCommit> ret
-
stack
private MergeBaseGenerator.CarryStack stack
-
CONTINUE
private static final int CONTINUE
- See Also:
- Constant Field Values
-
HAVE_ALL
private static final int HAVE_ALL
- See Also:
- Constant Field Values
-
CONTINUE_ON_STACK
private static final int CONTINUE_ON_STACK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MergeBaseGenerator
MergeBaseGenerator(RevWalk w)
-
-
Method Detail
-
init
void init(AbstractRevQueue p) throws java.io.IOException
- Throws:
java.io.IOException
-
add
private void add(RevCommit c)
-
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
private RevCommit _next() throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
- Throws:
MissingObjectExceptionIncorrectObjectTypeExceptionjava.io.IOException
-
next
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
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:
MissingObjectExceptionIncorrectObjectTypeExceptionjava.io.IOException
-
carryOntoHistory
private void carryOntoHistory(RevCommit c, int carry)
-
carryOntoHistoryInnerLoop
private void carryOntoHistoryInnerLoop(RevCommit c, int carry)
-
carryOntoOne
private int carryOntoOne(RevCommit p, int carry)
-
-