本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
示例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();
}
示例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());
}