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


Java RevCommit.getParentCount方法代码示例

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


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

示例1: detectAtCommit

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
public void detectAtCommit(Repository repository, String commitId, StructuralDiffHandler handler) {
	File metadataFolder = repository.getDirectory();
	File projectFolder = metadataFolder.getParentFile();
	GitService gitService = new GitServiceImpl();
	//RevWalk walk = new RevWalk(repository);
	try (RevWalk walk = new RevWalk(repository)) {
		RevCommit commit = walk.parseCommit(repository.resolve(commitId));
		if (commit.getParentCount() == 1) {
		    walk.parseCommit(commit.getParent(0));
		    this.detectRefactorings(gitService, repository, handler, projectFolder, commit);
		}
	} catch (Exception e) {
	    logger.warn(String.format("Ignored revision %s due to error", commitId), e);
	    handler.handleException(commitId, e);
       }
}
 
开发者ID:aserg-ufmg,项目名称:RefDiff,代码行数:17,代码来源:GitHistoryStructuralDiffAnalyzer.java

示例2: getCommitStatistics

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
/** 각 유저가 날짜별로 커밋을 한 정보를 취합함.
 * @return
 */
public GitParentStatistics getCommitStatistics(){
	GitParentStatistics gitParentStatistics = new GitParentStatistics();
	try{
		for(RevCommit rc:git.log().all().call()){
			String diffs = new String();
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			if(rc.getParentCount()>0){
				DiffFormatter df = new DiffFormatter(out);
				df.setRepository(this.localRepo);
				df.format(rc.getParent(0), rc);
				df.flush();
				diffs = out.toString();
			} else {
				diffs = simpleFileBrowser(rc);
			}
			int addFile = StringUtils.countOccurrencesOf(diffs, "--- /dev/null");// 추가한 파일 수
			int deleteFile = StringUtils.countOccurrencesOf(diffs, "+++ /dev/null");// 삭제한 파일 수
			diffs = StringUtils.delete(diffs, "\n--- ");
			diffs = StringUtils.delete(diffs, "\n+++ ");
			gitParentStatistics.addGitChildStatistics(
					new GitChildStatistics(
							rc.getAuthorIdent().getEmailAddress(), // 유저 이메일
							StringUtils.countOccurrencesOf(diffs, "\n+"), //추가한 라인 수
							StringUtils.countOccurrencesOf(diffs, "\n-"), //삭제한 라인 수
							addFile,
							deleteFile,
							rc.getAuthorIdent().getWhen())); // 날짜
		}

	}catch(Exception e){
		System.err.println(e.getMessage());
	}
	return gitParentStatistics;
}
 
开发者ID:forweaver,项目名称:forweaver2.0,代码行数:38,代码来源:GitUtil.java

示例3: include

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
@Override
public boolean include(RevWalk walker, RevCommit c) {
	return c.getParentCount() >= 2;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:5,代码来源:RevFilter.java

示例4: include

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
@Override
public final boolean include(final RevWalk walker, final RevCommit c) {
	return c.getParentCount() == 1 && !isCommitAnalyzed(c.getName());
}
 
开发者ID:aserg-ufmg,项目名称:RefDiff,代码行数:5,代码来源:GitHelper.java


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