本文整理汇总了Java中org.eclipse.jgit.revplot.PlotCommitList.fillTo方法的典型用法代码示例。如果您正苦于以下问题:Java PlotCommitList.fillTo方法的具体用法?Java PlotCommitList.fillTo怎么用?Java PlotCommitList.fillTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.revplot.PlotCommitList
的用法示例。
在下文中一共展示了PlotCommitList.fillTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseRawCommits
import org.eclipse.jgit.revplot.PlotCommitList; //导入方法依赖的package包/类
/**
* Utilizes JGit to walk through the repo and create raw commit objects - more
* specifically, JGit objects of (super)type RevCommit. This is an expensive
* operation and should only be called when necessary
*
* @param startPoints the starting ids to parse from
* @param stopPoints the ids at which parsing should stop
* @return a list of raw commits starting from each id in startPoints, excluding those beyond each id in stopPoints
* @throws IOException
*/
private PlotCommitList<PlotLane> parseRawCommits(List<ObjectId> startPoints, List<ObjectId> stopPoints) throws IOException {
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
PlotWalk w = new PlotWalk(repo);
for (ObjectId stopId : stopPoints) {
w.markUninteresting(w.parseCommit(stopId));
}
for (ObjectId startId : startPoints) {
w.markStart(w.parseCommit(startId));
PlotCommitList<PlotLane> temp = new PlotCommitList<>();
temp.source(w);
temp.fillTo(Integer.MAX_VALUE);
plotCommitList.addAll(temp);
}
w.dispose();
return plotCommitList;
}
示例2: main
import org.eclipse.jgit.revplot.PlotCommitList; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
try (Repository repository = CookbookHelper.openJGitCookbookRepository()) {
try (PlotWalk revWalk = new PlotWalk(repository)) {
ObjectId rootId = repository.resolve("refs/heads/master");
RevCommit root = revWalk.parseCommit(rootId);
revWalk.markStart(root);
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
System.out.println("Printing children of commit " + root);
for (RevCommit com : revWalk) {
System.out.println("Child: " + com);
}
System.out.println("Printing with next()");
System.out.println("next: " + revWalk.next());
}
}
}
示例3: getCommitsByTree
import org.eclipse.jgit.revplot.PlotCommitList; //导入方法依赖的package包/类
public PlotCommitList<PlotLane> getCommitsByTree(final String treeName) throws Exception {
try (PlotWalk revWalk = new PlotWalk(repository)) {
final ObjectId rootId = repository.resolve(treeName);
final RevCommit root = revWalk.parseCommit(rootId);
revWalk.markStart(root);
final PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
revWalk.dispose();
return plotCommitList;
}
}
示例4: generatePlotWalk
import org.eclipse.jgit.revplot.PlotCommitList; //导入方法依赖的package包/类
private PlotWalk generatePlotWalk() throws IOException {
Stopwatch stopwatch = new Stopwatch().start();
PlotWalk revWalk = new PlotWalk(repo());
logStartProvider.markStartsOn(revWalk);
PlotCommitList<PlotLane> plotCommitList = new PlotCommitList<PlotLane>();
plotCommitList.source(revWalk);
plotCommitList.fillTo(Integer.MAX_VALUE);
Log.d(TAG, "generatePlotWalk duration" + stopwatch.stop());
return revWalk;
}
示例5: graph
import org.eclipse.jgit.revplot.PlotCommitList; //导入方法依赖的package包/类
@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);
}
}