本文整理汇总了Java中org.eclipse.jgit.revplot.PlotCommitList类的典型用法代码示例。如果您正苦于以下问题:Java PlotCommitList类的具体用法?Java PlotCommitList怎么用?Java PlotCommitList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlotCommitList类属于org.eclipse.jgit.revplot包,在下文中一共展示了PlotCommitList类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNewCommits
import org.eclipse.jgit.revplot.PlotCommitList; //导入依赖的package包/类
/**
* Helper method that returns commits between the given old branch heads and new branch heads
*
* @param oldBranches previous locations of branch heads
* @param newBranches current locations of branch heads
* @return a list of all commits found between oldBranches and newBranches
* @throws GitAPIException
* @throws IOException
*/
private List<CommitHelper> getNewCommits(Map<String, BranchHelper> oldBranches, List<? extends BranchHelper> newBranches) throws GitAPIException, IOException {
List<ObjectId> startPoints = new ArrayList<>();
List<ObjectId> stopPoints = new ArrayList<>();
for (BranchHelper newBranch : newBranches) {
if (oldBranches.containsKey(newBranch.getRefName())) {
ObjectId newBranchHeadID = newBranch.getHeadId();
ObjectId oldBranchHeadID = oldBranches.get(newBranch.getRefName()).getHeadId();
if (!newBranchHeadID.equals(oldBranchHeadID)) {
startPoints.add(newBranchHeadID);
}
stopPoints.add(oldBranchHeadID);
} else {
startPoints.add(newBranch.getHeadId());
}
}
PlotCommitList<PlotLane> newCommits = this.parseRawCommits(startPoints, stopPoints);
return wrapRawCommits(newCommits);
}
开发者ID:dmusican,项目名称:Elegit,代码行数:29,代码来源:RepoHelper.java
示例2: parseAllRawLocalCommits
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
*
* @return a list of raw local commits
* @throws IOException
*/
private PlotCommitList<PlotLane> parseAllRawLocalCommits() throws IOException, GitAPIException {
ObjectId headId = repo.resolve("HEAD");
if (headId == null) return new PlotCommitList<>();
List<ObjectId> examinedCommitIDs = new ArrayList<>();
PlotCommitList<PlotLane> rawLocalCommits = parseRawCommits(headId, examinedCommitIDs);
examinedCommitIDs.add(headId);
List<LocalBranchHelper> branches = this.branchModel.getLocalBranchesTyped();
for (BranchHelper branch : branches) {
ObjectId branchId = branch.getHeadId();
PlotCommitList<PlotLane> toAdd = parseRawCommits(branchId, examinedCommitIDs);
if (toAdd.size() > 0) {
rawLocalCommits.addAll(toAdd);
examinedCommitIDs.add(toAdd.get(0).getId());
}
}
return rawLocalCommits;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:27,代码来源:RepoHelper.java
示例3: 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;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:33,代码来源:RepoHelper.java
示例4: 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());
}
}
}
开发者ID:centic9,项目名称:jgit-cookbook,代码行数:21,代码来源:ListChildrenOfCommit.java
示例5: 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;
}
}
开发者ID:iazarny,项目名称:gitember,代码行数:14,代码来源:GitRepositoryService.java
示例6: parseAllRawRemoteCommits
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
*
* @return a list of raw remote commits
* @throws IOException
*/
private PlotCommitList<PlotLane> parseAllRawRemoteCommits() throws IOException, GitAPIException {
List<ObjectId> examinedCommitIDs = new ArrayList<>();
PlotCommitList<PlotLane> rawRemoteCommits = new PlotCommitList<>();
for (BranchHelper branch : this.branchModel.getRemoteBranchesTyped()) {
ObjectId branchId = branch.getHeadId();
PlotCommitList<PlotLane> toAdd = parseRawCommits(branchId, examinedCommitIDs);
if (toAdd.size() > 0) {
rawRemoteCommits.addAll(toAdd);
examinedCommitIDs.add(toAdd.get(0).getId());
}
}
return rawRemoteCommits;
}
开发者ID:dmusican,项目名称:Elegit,代码行数:23,代码来源:RepoHelper.java
示例7: 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;
}
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:12,代码来源:CommitViewerActivity.java
示例8: GitPlotRenderer
import org.eclipse.jgit.revplot.PlotCommitList; //导入依赖的package包/类
public GitPlotRenderer(PlotCommitList<PlotLane> commitList) {
// Plot to create
plot = new GPlot();
// List of commit IDs
commits = new ArrayList<>();
// Loops over the commits
rowIndex = 0;
for (PlotCommit<PlotLane> commit : commitList) {
commits.add(commit);
currentCommit = commit;
paintCommit(commit, rowHeight);
rowIndex++;
}
}
开发者ID:nemerosa,项目名称:ontrack,代码行数:15,代码来源:GitPlotRenderer.java
示例9: 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);
}
}
开发者ID:nemerosa,项目名称:ontrack,代码行数:34,代码来源:GitRepositoryClientImpl.java
示例10: calculateLineColumnWidth
import org.eclipse.jgit.revplot.PlotCommitList; //导入依赖的package包/类
private int calculateLineColumnWidth(PlotCommitList<PlotLane> plotCommits) {
return 36 + 12 * plotCommits.stream().mapToInt(p -> p.getLane().getPosition()).max().orElse(0);
}
开发者ID:iazarny,项目名称:gitember,代码行数:4,代码来源:BranchViewController.java
示例11: parseAllLocalCommits
import org.eclipse.jgit.revplot.PlotCommitList; //导入依赖的package包/类
/**
* Constructs a list of all local commits found by parsing the repository for raw RevCommit objects,
* then wrapping them into a CommitHelper with the appropriate parents and children
*
* @return a list of CommitHelpers for all local commits
* @throws IOException
*/
private List<CommitHelper> parseAllLocalCommits() throws IOException, GitAPIException {
PlotCommitList<PlotLane> commitList = this.parseAllRawLocalCommits();
return wrapRawCommits(commitList);
}
开发者ID:dmusican,项目名称:Elegit,代码行数:12,代码来源:RepoHelper.java
示例12: parseAllRemoteCommits
import org.eclipse.jgit.revplot.PlotCommitList; //导入依赖的package包/类
/**
* Constructs a list of all remote commits found by parsing the repository for raw RevCommit objects,
* then wrapping them into a CommitHelper with the appropriate parents and children
*
* @return a list of CommitHelpers for all remote commits
* @throws IOException
*/
private List<CommitHelper> parseAllRemoteCommits() throws IOException, GitAPIException {
PlotCommitList<PlotLane> commitList = this.parseAllRawRemoteCommits();
return wrapRawCommits(commitList);
}
开发者ID:dmusican,项目名称:Elegit,代码行数:12,代码来源:RepoHelper.java
注:本文中的org.eclipse.jgit.revplot.PlotCommitList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论