本文整理匯總了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());
}