當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。