Class Candidate
- Direct Known Subclasses:
Candidate.BlobCandidate
,Candidate.HeadCandidate
,Candidate.ReverseCandidate
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 regionList
describing 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 uses
takeBlame(EditList, Candidate)
to accept responsibility for sections
of the result.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Candidate loaded from a file source, and not a commit.(package private) static final class
ACandidate
to blame a working tree file in conflict state.(package private) static final class
Special candidate type used for reverse blame. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Candidate
Next candidate in the candidate queue.(package private) Region
Chain of regions this candidate may be blamed for.(package private) int
Score assigned to the rename to this candidate.(package private) ObjectId
Unique name of the candidate blob insourceCommit
.(package private) RevCommit
Commit being considered (or blamed, depending on state).(package private) PathFilter
Path of the candidate file insourceCommit
.private Repository
repository used for LFS blob handling(package private) RawText
Complete contents of the file insourceCommit
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Region
(package private) void
(package private) void
beginResult
(RevWalk rw) private static void
(package private) boolean
canMergeRegions
(Candidate other) private Region
(package private) Candidate
(package private) Candidate
create
(Repository repo, RevCommit commit, PathFilter path) (package private) PersonIdent
(package private) Candidate
getNextCandidate
(int idx) (package private) RevCommit
getParent
(int idx) (package private) int
(package private) int
getTime()
(package private) boolean
(package private) void
loadText
(ObjectReader reader) (package private) void
mergeRegions
(Candidate other) (package private) void
(package private) void
toString()
-
Field Details
-
queueNext
Candidate queueNextNext candidate in the candidate queue. -
sourceCommit
RevCommit sourceCommitCommit being considered (or blamed, depending on state). -
sourcePath
PathFilter sourcePathPath of the candidate file insourceCommit
. -
sourceBlob
ObjectId sourceBlobUnique name of the candidate blob insourceCommit
. -
sourceText
RawText sourceTextComplete contents of the file insourceCommit
. -
regionList
Region regionListChain 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 renameScoreScore assigned to the rename to this candidate.Consider the history "Ainvalid input: '<'-Binvalid input: '<'-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
repository used for LFS blob handling
-
-
Constructor Details
-
Candidate
Candidate(Repository repo, RevCommit commit, PathFilter path)
-
-
Method Details
-
beginResult
- Throws:
MissingObjectException
IOException
-
getParentCount
int getParentCount() -
getParent
-
getNextCandidate
-
has
-
add
-
remove
-
getTime
int getTime() -
getAuthor
PersonIdent getAuthor() -
create
-
copy
-
loadText
- Throws:
IOException
-
takeBlame
-
blame
-
add
-
clearRegionList
-
canMergeRegions
-
mergeRegions
-
toString
-