Top Description Fields Constructors Methods
org.eclipse.jgit.blame

pack-priv Class BlameRegionMerger

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Collections, .List, org.eclipse.jgit.blame.cache.CacheRegion, org.eclipse.jgit.lib.ObjectId, .Repository, org.eclipse.jgit.revwalk.RevCommit, .RevWalk, org.eclipse.jgit.treewalk.filter.PathFilter

Translates an unblamed region into one or more blamed regions, using the fully blamed data from cache.

Blamed and unblamed regions are not symmetrical: An unblamed region is just a range of lines over the file. A blamed region is a Candidate (with the commit info) with a region inside (the range blamed).

Field Summary

Modifier and TypeField and Description
private final List<CacheRegion>
private final Repository
private final RevWalk

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Candidate
pack-priv List<CacheRegion>
findOverlaps(Region unblamed)

pack-priv static Region

Returns:

a new region with the intersection.
intersectRegions
(Region
a region from the blame generator
unblamed
,
CacheRegion
a cached region
cached
)

Calculate the intersection between a Region and a CacheRegion, adjusting the start if needed.

pack-priv Candidate

Returns:

A linked list of Candidates with their blamed regions, null if there was any error.
mergeCandidate
(Candidate
a candidate with a list of unblamed regions
candidate
)

Return one or more candidates blaming all the regions of the "unblamed" incoming candidate.

pack-priv List<Candidate>
protected RevCommit
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedRegionsback to summary
private final List<CacheRegion> cachedRegions
repoback to summary
private final Repository repo
rwback to summary
private final RevWalk rw

Constructor Detail

BlameRegionMergerback to summary
pack-priv BlameRegionMerger(Repository repo, RevWalk rw, List<CacheRegion> cachedRegions)

Method Detail

asLinkedCandidateback to summary
private static Candidate asLinkedCandidate(List<Candidate> c)
findOverlapsback to summary
pack-priv List<CacheRegion> findOverlaps(Region unblamed)
intersectRegionsback to summary
pack-priv static Region intersectRegions(Region unblamed, CacheRegion cached)

Calculate the intersection between a Region and a CacheRegion, adjusting the start if needed.

This should be called only if there is an overlap (filtering the cached regions with findOverlaps(Region)), otherwise the result is meaningless.

Parameters
unblamed:Region

a region from the blame generator

cached:CacheRegion

a cached region

Returns:Region

a new region with the intersection.

mergeCandidateback to summary
pack-priv Candidate mergeCandidate(Candidate candidate)

Return one or more candidates blaming all the regions of the "unblamed" incoming candidate.

Parameters
candidate:Candidate

a candidate with a list of unblamed regions

Returns:Candidate

A linked list of Candidates with their blamed regions, null if there was any error.

mergeOneRegionback to summary
pack-priv List<Candidate> mergeOneRegion(Region region) throws IOException
parseback to summary
protected RevCommit parse(ObjectId oid) throws IOException