• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PlotWalk类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jgit.revplot.PlotWalk的典型用法代码示例。如果您正苦于以下问题:Java PlotWalk类的具体用法?Java PlotWalk怎么用?Java PlotWalk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PlotWalk类属于org.eclipse.jgit.revplot包,在下文中一共展示了PlotWalk类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parseRawCommits

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的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


示例2: main

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的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


示例3: getCommitsByTree

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的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


示例4: generatePlotWalk

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的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


示例5: graph

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的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


示例6: setRepositoryContext

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的package包/类
public void setRepositoryContext(Repository repository, PlotWalk revWalk) {
    this.repository = repository;
    this.revWalk = revWalk;
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:5,代码来源:CommitView.java


示例7: setup

import org.eclipse.jgit.revplot.PlotWalk; //导入依赖的package包/类
private void setup(CommitView commitView, PlotWalk revWalk) {
    commitView.setRepositoryContext(repo(), revWalk);
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:4,代码来源:CommitViewerActivity.java



注:本文中的org.eclipse.jgit.revplot.PlotWalk类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VisibleAreaListener类代码示例发布时间:2022-05-23
下一篇:
Java AmazonElasticTranscoderClient类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap