本文整理汇总了Java中org.eclipse.egit.github.core.service.CommitService类的典型用法代码示例。如果您正苦于以下问题:Java CommitService类的具体用法?Java CommitService怎么用?Java CommitService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommitService类属于org.eclipse.egit.github.core.service包,在下文中一共展示了CommitService类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileDetails
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
@Override
public ChangesetFileDetailsEnvelope getFileDetails(Repository repository, Changeset changeset)
{
CommitService commitService = githubClientProvider.getCommitService(repository);
RepositoryId repositoryId = RepositoryId.create(repository.getOrgName(), repository.getSlug());
// Workaround for BBC-455
checkRequestRateLimit(commitService.getClient());
try
{
RepositoryCommit commit = commitService.getCommit(repositoryId, changeset.getNode());
return new ChangesetFileDetailsEnvelope(GithubChangesetFactory.transformToFileDetails(commit.getFiles()), commit.getFiles().size());
}
catch (IOException e)
{
throw new SourceControlException("could not get result", e);
}
}
示例2: connect
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public boolean connect(String username, String password){
this.username=username;
client = new GitHubClient();
client.setCredentials(username, password);
repoService = new MyRepositoriesService(client);
userService = new UserService(client);
issueService = new IssueService(client);
milestoneService = new MilestoneService(client);
labelService = new LabelService(client);
commitService = new CommitService(client);
markdownService = new MarkdownService(client);
colaboratorService = new CollaboratorService(client);
contentsService = new ContentsService(client);
try {
loadInformations();
return true;
} catch (IOException e) {
mainApp.writeNotification(e.getMessage());
return false;
}
}
示例3: getCommitsFromGitHub
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
/**
* Fetches list of commits form GitHub repository.
*
* @param auth
* @param owner
* @param name
* @param branch
* @return list of commits
* @throws IOException
*/
private List<RepositoryCommit> getCommitsFromGitHub(final String auth, final String owner, final String name,
final String branch) throws IOException {
GitHubClient client = new GitHubClient();
if (auth != null && !auth.isEmpty()) {
client.setOAuth2Token(auth);
} else {
log.warn("OAuth2Token not set");
}
CommitService cs = new CommitService(client);
RepositoryService rs = new RepositoryService(client);
final Repository repository = rs.getRepository(owner, name);
return cs.getCommits(repository, branch, null);
}
示例4: GitHubBuilder
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public GitHubBuilder(String token) {
this.githubClient = new GitHubClient();
githubClient.setOAuth2Token(token);
uService = new UserService(githubClient);
oService = new OrganizationService(githubClient);
service = new RepositoryService(githubClient);
cService = new ContentsService(githubClient);
dService = new DataService(githubClient);
commitService = new CommitService(githubClient);
}
示例5: getPageIterator
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
@SuppressWarnings ("unused")
public PageIterator<RepositoryCommit> getPageIterator(Repository repository, String branch)
{
final CommitService commitService = githubClientProvider.getCommitService(repository);
return commitService.pageCommits(RepositoryId.create(repository.getOrgName(), repository.getSlug()),
doTheUtfEncoding(branch), null);
}
示例6: commitStore
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
@Provides
CommitStore commitStore(CommitService service) {
CommitStore store = commits != null ? commits.get() : null;
if (store == null) {
store = new CommitStore(service);
commits = new WeakReference<CommitStore>(store);
}
return store;
}
示例7: onPreExecute
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
@Override
protected void onPreExecute() {
flag = fragment.getFlag();
GitHubClient client = fragment.getClient();
commitService = new CommitService(client);
adapter = fragment.getCommitItemAdapter();
list = fragment.getCommitItemList();
fragment.setContentShown(false);
}
示例8: onPreExecute
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
@Override
protected void onPreExecute() {
mainFragment.setContentShown(false);
mainFragment.setRefreshStatus(true);
context = mainFragment.getContentView().getContext();
GitHubClient gitHubClient = mainFragment.getGitHubClient();
repositoryService = new RepositoryService(gitHubClient);
commitService = new CommitService(gitHubClient);
commitItemAdapter = mainFragment.getCommitItemAdapter();
commitItemList = mainFragment.getCommitItemList();
}
示例9: reportSuccesses
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
private void reportSuccesses(int successCounter) throws IOException {
System.out.println(successCounter +" things went well");
GitHubClient client = new GitHubClient();
String botUserName = System.getProperty("testUserName");
String botPassword = System.getProperty("testUserPass");
client.setCredentials(botUserName, botPassword);
String sha = System.getenv("TRAVIS_COMMIT");
System.out.println("making a comment on commit "+sha);
RepositoryService repoService = new RepositoryService(client);
Repository repo = repoService.getRepository("DeveloperLiberationFront", "Pdf-Reviewer");
CommitService service = new CommitService(client);
CommitComment comment = new CommitComment();
String message = "step | pass?\n" +
"--- | --- \n" +
"canary site online | :fire: \n" +
"authenticated with GitHub | :fire: \n" +
"no carry over reviews | ::fire: \n" +
"created request | :fire: \n" +
"Uploaded pdf | :fire: \n" +
"Found issues in GitHub | :fire: \n";
for(int i = 0; i< successCounter; i++) {
message = message.replaceFirst(":fire:", ":white_check_mark:");
}
comment.setBody(message);
service.addComment(repo, sha, comment);
}
示例10: commitService
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public CommitService commitService() {
return new CommitService(client);
}
示例11: getCommitService
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public CommitService getCommitService(Repository repository)
{
return new CommitService(createClient(repository));
}
示例12: main
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
GitHubClient client = new GitHubClient();
if (args.length == 1) {
client.setOAuth2Token(args[0]);
}
CommitService cs = new CommitService(client);
RepositoryService rs = new RepositoryService(client);
final Repository repository = rs.getRepository("hazelcast", "hazelcast");
final List<RepositoryCommit> commits = cs.getCommits(repository, "3.0", null);
System.out.println(commits.size());
for (RepositoryCommit commit : commits) {
System.out.println(commit.getSha());
}
}
示例13: CommitStore
import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
/**
* Create commit store
*
* @param service
*/
public CommitStore(final CommitService service) {
this.service = service;
}