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


Java CommitService类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:20,代码来源:GithubCommunicator.java

示例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;
		}
	}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:27,代码来源:GitHubModel.java

示例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);

}
 
开发者ID:ever-been,项目名称:benchmark-hazelcast3,代码行数:29,代码来源:HazelcastBenchmark.java

示例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);
}
 
开发者ID:dockstore,项目名称:write_api_service,代码行数:12,代码来源:GitHubBuilder.java

示例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);

}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:10,代码来源:GithubCommunicator.java

示例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;
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:10,代码来源:GitHubModule.java

示例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);
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:13,代码来源:CommitTask.java

示例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();
}
 
开发者ID:mthli,项目名称:Bitocle,代码行数:15,代码来源:CommitTask.java

示例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);
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:32,代码来源:BrowserTest.java

示例10: commitService

import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public CommitService commitService() {
    return new CommitService(client);
}
 
开发者ID:kbastani,项目名称:service-block-samples,代码行数:4,代码来源:GitHubTemplate.java

示例11: getCommitService

import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
public CommitService getCommitService(Repository repository)
{
    return new CommitService(createClient(repository));
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:5,代码来源:GithubClientProvider.java

示例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());
		}


	}
 
开发者ID:ever-been,项目名称:benchmark-hazelcast3,代码行数:25,代码来源:GitHubTest.java

示例13: CommitStore

import org.eclipse.egit.github.core.service.CommitService; //导入依赖的package包/类
/**
 * Create commit store
 *
 * @param service
 */
public CommitStore(final CommitService service) {
    this.service = service;
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:9,代码来源:CommitStore.java


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