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


Java RevCommit.getCommitTime方法代码示例

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


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

示例1: getGitFileInfoList

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
/** 저장소의 파일 정보들을 가져와 파일 브라우져를 보여줄 때 사용.
 * @param commitID
 * @param filePath
 * @return
 */
public List<VCSimpleFileInfo> getGitFileInfoList(String commitID,String filePath) {
	List<VCSimpleFileInfo> gitFileInfoList = new ArrayList<VCSimpleFileInfo>();
	List<String> fileList = this.getGitFileList(commitID);
	try{			
		for(String path: WebUtil.getFileList(fileList, "/"+filePath)){
			RevCommit revCommit = CommitUtils.getLastCommit(this.localRepo,
					commitID, path.substring(1));
			String[] strArray = path.substring(1).split("/");
			VCSimpleFileInfo gitFileInfo = new VCSimpleFileInfo(
					strArray[strArray.length-1], path.substring(1),
					isDirectory(commitID,path.substring(1)),
					revCommit.getName(), revCommit.getShortMessage(),
					revCommit.getCommitTime(),
					revCommit.getCommitterIdent().getName(),
					revCommit.getCommitterIdent().getEmailAddress());
			gitFileInfoList.add(gitFileInfo);
		}

	}catch(Exception e){}
	return gitFileInfoList;
}
 
开发者ID:forweaver,项目名称:forweaver2.0,代码行数:27,代码来源:GitUtil.java

示例2: getLogList

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
public List<VCSimpleLog> getLogList(String branchName,
		int page, int number) {
	List<VCSimpleLog> gitLogList = new ArrayList<VCSimpleLog>();
	int startNumber = number * (page - 1);
	try {

		for(RevCommit commit:git.log().add(
				this.getCommit(branchName)).setSkip(startNumber).setMaxCount(number).call()){

			VCSimpleLog gitLog = new VCSimpleLog(commit
					.getId().getName(), commit.getShortMessage(), commit
					.getCommitterIdent().getName(), commit
					.getCommitterIdent().getEmailAddress(),
					commit.getCommitTime());

			gitLogList.add(gitLog);
		}

	} finally {
		return gitLogList;
	}
}
 
开发者ID:forweaver,项目名称:forweaver2.0,代码行数:23,代码来源:GitUtil.java

示例3: getLastCommit

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
public RevCommit getLastCommit() {
	if (lastCommitOptional == null) {
		RevCommit lastCommit = null;
		try {
			for (Ref ref: getRepository().getRefDatabase().getRefs(Constants.R_HEADS).values()) {
				RevCommit commit = getRevCommit(ref.getObjectId(), false);
				if (commit != null) {
					if (lastCommit != null) {
						if (commit.getCommitTime() > lastCommit.getCommitTime())
							lastCommit = commit;
					} else {
						lastCommit = commit;
					}
				}
			}
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		lastCommitOptional = Optional.fromNullable(lastCommit);
	}
	return lastCommitOptional.orNull();
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:23,代码来源:Project.java

示例4: VCSimpleLog

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
public VCSimpleLog(RevCommit revCommit){
	if(revCommit == null)
		return;
	this.logID = revCommit.getName();
	this.shortMassage = revCommit.getShortMessage();
	this.commiterName = revCommit.getAuthorIdent().getName();
	this.commiterEmail =  revCommit.getAuthorIdent().getEmailAddress();
	this.commitDate = new Date(revCommit.getCommitTime()*1000L);
}
 
开发者ID:forweaver,项目名称:forweaver2.0,代码行数:10,代码来源:VCSimpleLog.java

示例5: include

import org.eclipse.jgit.revwalk.RevCommit; //导入方法依赖的package包/类
@Override
public boolean include(final RevWalk walker, final RevCommit cmit)
		throws StopWalkException, MissingObjectException,
		IncorrectObjectTypeException, IOException {
	// Since the walker sorts commits by commit time we can be
	// reasonably certain there is nothing remaining worth our
	// scanning if this commit is before the point in question.
	//
	if (cmit.getCommitTime() < when)
		throw StopWalkException.INSTANCE;
	return true;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:CommitTimeRevFilter.java


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