Top Description Inners Fields Constructors Methods
org.eclipse.jgit.revwalk

pack-priv Class MergeBaseGenerator

extends Generator
Class Inheritance
Imports
java.io.IOException, java.text.MessageFormat, java.util.ArrayDeque, org.eclipse.jgit.errors.IncorrectObjectTypeException, .MissingObjectException, org.eclipse.jgit.internal.JGitText

Computes the merge base(s) of the starting commits.

This generator is selected if the RevFilter is only org.eclipse.jgit.revwalk.filter.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 and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private 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 ArrayDeque<RevCommit>
private MergeBaseGenerator.CarryStack
private final RevWalk
Inherited from org.eclipse.jgit.revwalk.Generator:
firstParentHAS_REWRITEHAS_UNINTERESTINGNEEDS_REWRITESORT_COMMIT_TIME_DESCSORT_TOPO

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private RevCommit
private void
private void
private void
private int
carryOntoOne(RevCommit p, int carry)

pack-priv void
pack-priv RevCommit
next()

Implements abstract org.eclipse.jgit.revwalk.Generator.next.

Return the next commit to the application, or the next generator.

pack-priv int
outputType()

Implements abstract org.eclipse.jgit.revwalk.Generator.outputType.

Obtain flags describing the output behavior of this generator.

Inherited from org.eclipse.jgit.revwalk.Generator:
shareFreeList

Field Detail

branchMaskback to summary
private int branchMask
CONTINUEback to summary
private static final int CONTINUE
CONTINUE_ON_STACKback to summary
private static final int CONTINUE_ON_STACK
HAVE_ALLback to summary
private static final int HAVE_ALL
IN_PENDINGback to summary
private static final int IN_PENDING
MERGE_BASEback to summary
private static final int MERGE_BASE
mergeBaseAncestorback to summary
private int mergeBaseAncestor
PARSEDback to summary
private static final int PARSED
pendingback to summary
private final DateRevQueue pending
POPPEDback to summary
private static final int POPPED
recarryMaskback to summary
private int recarryMask
recarryTestback to summary
private int recarryTest
retback to summary
private ArrayDeque<RevCommit> ret
stackback to summary
private MergeBaseGenerator.CarryStack stack
walkerback to summary
private final RevWalk walker

Constructor Detail

MergeBaseGeneratorback to summary
pack-priv MergeBaseGenerator(RevWalk w)

Method Detail

_nextback to summary
private RevCommit _next() throws MissingObjectException, IncorrectObjectTypeException, IOException
addback to summary
private void add(RevCommit c)
carryOntoHistoryback to summary
private void carryOntoHistory(RevCommit c, int carry)
carryOntoHistoryInnerLoopback to summary
private void carryOntoHistoryInnerLoop(RevCommit c, int carry)
carryOntoOneback to summary
private int carryOntoOne(RevCommit p, int carry)
initback to summary
pack-priv void init(AbstractRevQueue p) throws IOException
nextback to summary
pack-priv RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException

Implements abstract org.eclipse.jgit.revwalk.Generator.next.

Doc from org.eclipse.jgit.revwalk.Generator.next.

Return the next commit to the application, or the next generator.

Returns:RevCommit

next available commit; null if no more are to be returned.

Annotations
@Override
Exceptions
MissingObjectException:
if an object is missing
IncorrectObjectTypeException:
if an object has an unexpected type
IOException:
if an IO error occurred
outputTypeback to summary
pack-priv int outputType()

Implements abstract org.eclipse.jgit.revwalk.Generator.outputType.

Doc from org.eclipse.jgit.revwalk.Generator.outputType.

Obtain flags describing the output behavior of this generator.

Returns:int

one or more of the constants declared in this class, describing how this generator produces its results.

Annotations
@Override
org.eclipse.jgit.revwalk back to summary

private Class MergeBaseGenerator.CarryStack

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final RevCommit
c

pack-priv final int
pack-priv final MergeBaseGenerator.CarryStack

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cback to summary
pack-priv final RevCommit c
carryback to summary
pack-priv final int carry
prevback to summary
pack-priv final MergeBaseGenerator.CarryStack prev

Constructor Detail

CarryStackback to summary
pack-priv CarryStack(MergeBaseGenerator.CarryStack prev, RevCommit c, int carry)