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


Java RevWalk.reset方法代码示例

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


在下文中一共展示了RevWalk.reset方法的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: updateWithRemoteFile

import org.eclipse.jgit.revwalk.RevWalk; //导入方法依赖的package包/类
public void updateWithRemoteFile(String filePath) {
	try {
		RevWalk walk = new RevWalk(git.getRepository());
		walk.reset();
		RevCommit commit = walk.parseCommit(git.getRepository().resolve("MERGE_HEAD"));
		git.checkout().setStartPoint(commit).addPath(filePath).call();
		walk.close();
	} catch (Exception e) {
		if (logger.isDebugEnabled()) {
			logger.debug(e, e);
		}
	}
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:14,代码来源:GitAccess.java


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