当前位置: 首页>>代码示例>>Java>>正文


Java RevWalk.next方法代码示例

本文整理汇总了Java中org.eclipse.jgit.revwalk.RevWalk.next方法的典型用法代码示例。如果您正苦于以下问题:Java RevWalk.next方法的具体用法?Java RevWalk.next怎么用?Java RevWalk.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.revwalk.RevWalk的用法示例。


在下文中一共展示了RevWalk.next方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSingleBaseCommit

import org.eclipse.jgit.revwalk.RevWalk; //导入方法依赖的package包/类
private GitRevisionInfo getSingleBaseCommit (RevWalk walk, List<RevCommit> commits) throws IOException {
    while (commits.size() > 1) {
        walk.reset();
        for (RevCommit c : commits) {
            walk.markStart(walk.parseCommit(c));
        }
        walk.setRevFilter(RevFilter.MERGE_BASE);
        commits.clear();
        for (RevCommit commit = walk.next(); commit != null; commit = walk.next()) {
            commits.add(commit);
        }
    }
    if (commits.isEmpty()) {
        return null;
    } else {
        return getClassFactory().createRevisionInfo(commits.get(0), getRepository());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:GetCommonAncestorCommand.java

示例2: getCommonAncestor

import org.eclipse.jgit.revwalk.RevWalk; //导入方法依赖的package包/类
/**
 * Finds the common base for the given commit "a" and the given commit "b"
 * 
 * @param walk
 *          - used to browse through commits
 * @param a
 *          - commit "a"
 * @param b
 *          - commit "b"
 * @return the bese commit
 * @throws IncorrectObjectTypeException
 * @throws IOException
 */
private RevCommit getCommonAncestor(RevWalk walk, RevCommit a, RevCommit b)
		throws IOException {
	walk.reset();
	walk.setRevFilter(RevFilter.MERGE_BASE);
	walk.markStart(a);
	walk.markStart(b);
	final RevCommit base = walk.next();
	if (base == null)
		return null;
	final RevCommit base2 = walk.next();
	if (base2 != null) {
		throw new NoMergeBaseException(MergeBaseFailureReason.MULTIPLE_MERGE_BASES_NOT_SUPPORTED,
				MessageFormat.format(JGitText.get().multipleMergeBasesFor, a.name(), b.name(), base.name(), base2.name()));
	}
	return base;
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:30,代码来源:GitAccess.java

示例3: getSrcCommit

import org.eclipse.jgit.revwalk.RevWalk; //导入方法依赖的package包/类
public RevCommit getSrcCommit() {
    try {
        RevWalk revWalk = new RevWalk(git.getRepository());
        AnyObjectId headId = git.getRepository().resolve(Constants.HEAD);
        RevCommit root = revWalk.parseCommit(headId);
        revWalk.sort(RevSort.REVERSE);
        revWalk.markStart(root);
        return revWalk.next();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:PizzaCrust,项目名称:IodineToolkit,代码行数:13,代码来源:PatchService.java


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