use of net.nemerosa.ontrack.git.model.plot.GPlot in project ontrack by nemerosa.
the class GitRepositoryClientImpl method graph.
@Override
public GitLog graph(String from, String to) {
try {
GitRange range = range(from, to, false);
PlotWalk walk = new PlotWalk(git.getRepository());
// Log
walk.markStart(walk.lookupCommit(range.getFrom().getId()));
walk.markUninteresting(walk.lookupCommit(range.getTo().getId()));
PlotCommitList<PlotLane> commitList = new PlotCommitList<>();
commitList.source(walk);
commitList.fillTo(Integer.MAX_VALUE);
// Rendering
GitPlotRenderer renderer = new GitPlotRenderer(commitList);
GPlot plot = renderer.getPlot();
// Gets the commits
List<GitCommit> commits = Lists.transform(renderer.getCommits(), this::toCommit);
// OK
return new GitLog(plot, commits);
} catch (IOException e) {
throw new GitRepositoryIOException(repository.getRemote(), e);
}
}
Aggregations