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


Java PersonIdent.getWhen方法代码示例

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


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

示例1: getRevisionData

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@Override
public FileVersion[] getRevisionData(String label, File... files) {
  // Workaround for CachingPage
  if (label == null) {
    return persistence.getRevisionData(null, files);
  }
  RevCommit revCommit;
  Repository repository = getRepository(files[0]);
  FileVersion[] versions = new FileVersion[files.length];

  try {
    ObjectId rev = repository.resolve(label);
    RevWalk walk = new RevWalk(repository);
    revCommit = walk.parseCommit(rev);
    PersonIdent author = revCommit.getAuthorIdent();
    int counter = 0;
    for (File file : files) {
      String path = getPath(file, repository);
      byte[] content = getRepositoryContent(repository, revCommit, path);
      versions[counter++] = new GitFileVersion(file, content, author.getName(), author.getWhen());
    }
  } catch (IOException e) {
    throw new RuntimeException("Unable to get data for revision " + label, e);
  }
  return versions;
}
 
开发者ID:fitnesse,项目名称:fitnesse-git-plugin,代码行数:27,代码来源:GitFileVersionsController.java

示例2: setAuthor

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@Override
public void setAuthor(String name, String email) {
	PersonIdent author = this.commit.getAuthor();
	Date origWhen = author.getWhen();
	TimeZone origTZ = author.getTimeZone();
	this.authorUpdate = new PersonIdent(name, email, origWhen, origTZ);
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:8,代码来源:CacheCommitUpdate.java

示例3: setCommitter

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@Override
public void setCommitter(String name, String email) {
	PersonIdent committer = this.commit.getCommitter();
	Date origWhen = committer.getWhen();
	TimeZone origTZ = committer.getTimeZone();
	this.committerUpdate = new PersonIdent(name, email, origWhen, origTZ);
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:8,代码来源:CacheCommitUpdate.java

示例4: evaluate

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@Override
public boolean evaluate(ReflogEntry reflogEntry) {
	PersonIdent who = reflogEntry.getWho();

	TimeZone timeZone = who.getTimeZone();
	Calendar reflogEntryCalendar = Calendar.getInstance(timeZone);
	Date when = who.getWhen();
	reflogEntryCalendar.setTime(when);

	boolean isNotExpired = reflogEntryCalendar.after(expireCalendar);
	return isNotExpired;
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:13,代码来源:ExpireReflogCommand.java

示例5: getAuditLogAuthorIdent

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private static PersonIdent getAuditLogAuthorIdent(
    Account author, PersonIdent serverIdent, String serverId, String anonymousCowardName) {
  return new PersonIdent(
      author.getName(anonymousCowardName),
      getEmailForAuditLog(author.getId(), serverId),
      serverIdent.getWhen(),
      serverIdent.getTimeZone());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:GroupsUpdate.java

示例6: ChangeUpdate

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@AssistedInject
private ChangeUpdate(
    @GerritServerConfig Config cfg,
    @GerritPersonIdent PersonIdent serverIdent,
    @AnonymousCowardName String anonymousCowardName,
    NotesMigration migration,
    AccountCache accountCache,
    NoteDbUpdateManager.Factory updateManagerFactory,
    ChangeDraftUpdate.Factory draftUpdateFactory,
    RobotCommentUpdate.Factory robotCommentUpdateFactory,
    DeleteCommentRewriter.Factory deleteCommentRewriterFactory,
    ProjectCache projectCache,
    @Assisted ChangeNotes notes,
    @Assisted CurrentUser user,
    ChangeNoteUtil noteUtil) {
  this(
      cfg,
      serverIdent,
      anonymousCowardName,
      migration,
      accountCache,
      updateManagerFactory,
      draftUpdateFactory,
      robotCommentUpdateFactory,
      deleteCommentRewriterFactory,
      projectCache,
      notes,
      user,
      serverIdent.getWhen(),
      noteUtil);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:32,代码来源:ChangeUpdate.java

示例7: getMergedCommits

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public Collection<Post> getMergedCommits(Date daysAgo, String remoteURL, String webCommitURL) {
	Collection<RevCommit> allCommits = getAllCommits(remoteURL, true);

	List<Post> posts = new ArrayList<Post>();
	for (RevCommit commit : allCommits) {
		PersonIdent authorIdent = commit.getAuthorIdent();
		Date authorDate = authorIdent.getWhen();
		if (authorDate.after(daysAgo)) {
			StringBuffer body = new StringBuffer();
			boolean first = true;
			for (String line : Splitter.on('\n').omitEmptyStrings().split(commit.getFullMessage())) {
				if (line.contains("Change-Id:")) {

				} else if (line.contains("Bug: ")) {

				} else if (line.contains("Signed-off-by:")) {

				} else {
					if (!first) {
						body.append(line);
						body.append('\n');
					}
				}
				first = false;
			}

			// [some thing] dflgkj,fdlg [sss]
			// [1248]
			// [ 1248 ]

			String url = webCommitURL + commit.getId().name();
			Set<String> branches = Sets.newLinkedHashSet();
			RevWalk walk = new RevWalk(repo.getRepository());
			for (Map.Entry<String, Ref> e : repo.getRepository().getAllRefs().entrySet())
				if (e.getKey().startsWith(Constants.R_HEADS))
					try {
						if (walk.isMergedInto(commit, walk.parseCommit(e.getValue().getObjectId()))) {
							branches.add(e.getValue().getName());
						}
					} catch (IOException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
					}

			String title = commit.getShortMessage();
			if (branches.size() > 0) {
				title = "[" + Joiner.on(',').join(branches) + "] " + title;
			}
			title = detectBugzillaLink(title);
			Post newPost = Post.createPostWithSubject(url, title, body.toString(), authorIdent.getName(), GIT_ICON,
					authorDate);
			newPost.addURLs(url);
			posts.add(newPost);
		}
	}

	return posts;
}
 
开发者ID:cbrun,项目名称:jstuart,代码行数:59,代码来源:GitLogger.java

示例8: PersonIdentDTO

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public PersonIdentDTO(PersonIdent ident) {
    this.name = ident.getName();
    this.emailAddress = ident.getEmailAddress();
    this.timeZone = ident.getTimeZone().getID();
    this.when = ident.getWhen();
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:7,代码来源:PersonIdentDTO.java

示例9: makeVersionInfo

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private GitVersionInfo makeVersionInfo(RevCommit revCommit) {
  PersonIdent authorIdent = revCommit.getAuthorIdent();
  return new GitVersionInfo(revCommit.name(), authorIdent.getName(), authorIdent.getWhen(), revCommit.getShortMessage());
}
 
开发者ID:fitnesse,项目名称:fitnesse-git-plugin,代码行数:5,代码来源:GitFileVersionsController.java


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