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