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 class
MergeBaseGenerator.CarryStack
-
Field Summary
Fields Modifier and Type Field Description private int
branchMask
private static int
CONTINUE
private static int
CONTINUE_ON_STACK
private static int
HAVE_ALL
private static int
IN_PENDING
private static int
MERGE_BASE
private int
mergeBaseAncestor
private static int
PARSED
private DateRevQueue
pending
private static int
POPPED
private int
recarryMask
private int
recarryTest
private java.util.LinkedList<RevCommit>
ret
private MergeBaseGenerator.CarryStack
stack
private RevWalk
walker
-
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 void
add(RevCommit c)
private void
carryOntoHistory(RevCommit c, int carry)
private void
carryOntoHistoryInnerLoop(RevCommit c, int carry)
private int
carryOntoOne(RevCommit p, int carry)
(package private) void
init(AbstractRevQueue p)
(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.-
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: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
private RevCommit _next() throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
- Throws:
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
-
next
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
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
java.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)
-
-