本文整理汇总了Java中git4idea.changes.GitCommittedChangeList类的典型用法代码示例。如果您正苦于以下问题:Java GitCommittedChangeList类的具体用法?Java GitCommittedChangeList怎么用?Java GitCommittedChangeList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GitCommittedChangeList类属于git4idea.changes包,在下文中一共展示了GitCommittedChangeList类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLocalCommittedChanges
import git4idea.changes.GitCommittedChangeList; //导入依赖的package包/类
public static List<GitCommittedChangeList> getLocalCommittedChanges(final Project project,
final VirtualFile root,
final Consumer<GitSimpleHandler> parametersSpecifier)
throws VcsException {
final List<GitCommittedChangeList> rc = new ArrayList<GitCommittedChangeList>();
getLocalCommittedChanges(project, root, parametersSpecifier, new Consumer<GitCommittedChangeList>() {
public void consume(GitCommittedChangeList committedChangeList) {
rc.add(committedChangeList);
}
}, false);
return rc;
}
示例2: loadRevisionsFromGit
import git4idea.changes.GitCommittedChangeList; //导入依赖的package包/类
@Nullable
public static CommittedChangeList loadRevisionsFromGit(@NotNull final Project project,
final VirtualFile virtualFile,
final VcsRevisionNumber number) {
final CommittedChangeList[] list = new CommittedChangeList[1];
final ThrowableRunnable<VcsException> runnable = () -> {
FilePath filePath = VcsUtil.getFilePath(virtualFile);
FilePath lastCommitName = GitHistoryUtils.getLastCommitName(project, filePath);
GitRepository repository = GitRepositoryManager.getInstance(project).getRepositoryForFile(lastCommitName);
if (repository == null) {
return;
}
VirtualFile root = repository.getRoot();
List<VcsFullCommitDetails> gitCommits = ContainerUtil.newArrayList();
GitHistoryUtils.loadDetails(project, root, gitCommits::add,
GitHistoryUtils.formHashParameters(repository.getVcs(), Collections.singleton(number.asString())));
if (gitCommits.size() != 1) {
return;
}
VcsFullCommitDetails gitCommit = gitCommits.get(0);
CommittedChangeList commit = new GitCommittedChangeList(gitCommit.getFullMessage() + " (" + gitCommit.getId().toShortString() + ")",
gitCommit.getFullMessage(), VcsUserUtil.toExactString(gitCommit.getAuthor()),
(GitRevisionNumber)number,
new Date(gitCommit.getAuthorTime()), gitCommit.getChanges(),
assertNotNull(GitVcs.getInstance(project)), true);
list[0] = commit;
};
final boolean success = VcsSynchronousProgressWrapper.wrap(runnable, project, "Load revision contents");
return success ? list[0] : null;
}