Class Candidate
- java.lang.Object
-
- org.eclipse.jgit.blame.Candidate
-
- Direct Known Subclasses:
Candidate.BlobCandidate,Candidate.HeadCandidate,Candidate.ReverseCandidate
class Candidate extends java.lang.ObjectA source that may have supplied some (or all) of the result file.Candidates are kept in a queue by BlameGenerator, allowing the generator to perform a parallel search down the parents of any merges that are discovered during the history traversal. Each candidate retains a
regionListdescribing sections of the result file the candidate has taken responsibility for either directly or indirectly through its history. Actual blame from this region list will be assigned to the candidate when its ancestor commit(s) are themselves converted into Candidate objects and the ancestor's candidate usestakeBlame(EditList, Candidate)to accept responsibility for sections of the result.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classCandidate.BlobCandidateCandidate loaded from a file source, and not a commit.(package private) static classCandidate.HeadCandidateACandidateto blame a working tree file in conflict state.(package private) static classCandidate.ReverseCandidateSpecial candidate type used for reverse blame.
-
Field Summary
Fields Modifier and Type Field Description (package private) CandidatequeueNextNext candidate in the candidate queue.(package private) RegionregionListChain of regions this candidate may be blamed for.(package private) intrenameScoreScore assigned to the rename to this candidate.(package private) ObjectIdsourceBlobUnique name of the candidate blob insourceCommit.(package private) RevCommitsourceCommitCommit being considered (or blamed, depending on state).(package private) PathFiltersourcePathPath of the candidate file insourceCommit.private RepositorysourceRepositoryrepository used for LFS blob handling(package private) RawTextsourceTextComplete contents of the file insourceCommit.
-
Constructor Summary
Constructors Constructor Description Candidate(Repository repo, RevCommit commit, PathFilter path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Regionadd(Region aTail, Candidate a, Region n)(package private) voidadd(RevFlag flag)(package private) voidbeginResult(RevWalk rw)private static voidblame(EditList editList, Candidate a, Candidate b)(package private) booleancanMergeRegions(Candidate other)private RegionclearRegionList()(package private) Candidatecopy(RevCommit commit)(package private) Candidatecreate(Repository repo, RevCommit commit, PathFilter path)(package private) PersonIdentgetAuthor()(package private) CandidategetNextCandidate(int idx)(package private) RevCommitgetParent(int idx)(package private) intgetParentCount()(package private) intgetTime()(package private) booleanhas(RevFlag flag)(package private) voidloadText(ObjectReader reader)(package private) voidmergeRegions(Candidate other)(package private) voidremove(RevFlag flag)(package private) voidtakeBlame(EditList editList, Candidate child)java.lang.StringtoString()
-
-
-
Field Detail
-
queueNext
Candidate queueNext
Next candidate in the candidate queue.
-
sourceCommit
RevCommit sourceCommit
Commit being considered (or blamed, depending on state).
-
sourcePath
PathFilter sourcePath
Path of the candidate file insourceCommit.
-
sourceBlob
ObjectId sourceBlob
Unique name of the candidate blob insourceCommit.
-
sourceText
RawText sourceText
Complete contents of the file insourceCommit.
-
regionList
Region regionList
Chain of regions this candidate may be blamed for.This list is always kept sorted by resultStart order, making it simple to merge-join with the sorted EditList during blame assignment.
-
renameScore
int renameScore
Score assigned to the rename to this candidate.Consider the history "A<-B<-C". If the result file S in C was renamed to R in B, the rename score for this rename will be held in this field by the candidate object for B. By storing the score with B, the application can see what the rename score was as it makes the transition from C/S to B/R. This may seem backwards since it was C that performed the rename, but the application doesn't learn about path R until B.
-
sourceRepository
private Repository sourceRepository
repository used for LFS blob handling
-
-
Constructor Detail
-
Candidate
Candidate(Repository repo, RevCommit commit, PathFilter path)
-
-
Method Detail
-
beginResult
void beginResult(RevWalk rw) throws MissingObjectException, java.io.IOException
- Throws:
MissingObjectExceptionjava.io.IOException
-
getParentCount
int getParentCount()
-
getParent
RevCommit getParent(int idx)
-
getNextCandidate
Candidate getNextCandidate(int idx)
-
has
boolean has(RevFlag flag)
-
add
void add(RevFlag flag)
-
remove
void remove(RevFlag flag)
-
getTime
int getTime()
-
getAuthor
PersonIdent getAuthor()
-
create
Candidate create(Repository repo, RevCommit commit, PathFilter path)
-
loadText
void loadText(ObjectReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
clearRegionList
private Region clearRegionList()
-
canMergeRegions
boolean canMergeRegions(Candidate other)
-
mergeRegions
void mergeRegions(Candidate other)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-