[vcs-log] introduce readMetadata method, deprecate readShortDetails

This commit is contained in:
Julia Beliaeva
2018-07-12 19:04:29 +03:00
parent aadec8aaa0
commit f3ec755ef5
6 changed files with 15 additions and 6 deletions
@@ -77,7 +77,16 @@ public interface VcsLogProvider {
* Reads those details of the given commits, which are necessary to be shown in the log table.
*/
@NotNull
List<? extends VcsCommitMetadata> readShortDetails(@NotNull VirtualFile root, @NotNull List<String> hashes) throws VcsException;
@Deprecated
default List<? extends VcsShortCommitDetails> readShortDetails(@NotNull VirtualFile root, @NotNull List<String> hashes)
throws VcsException {
return readMetadata(root, hashes);
}
/**
* Reads those details of the given commits, which are necessary to be shown in the log table and commit details.
*/
List<? extends VcsCommitMetadata> readMetadata(@NotNull VirtualFile root, @NotNull List<String> hashes) throws VcsException;
/**
* Read full details of the given commits from the VCS.
@@ -46,7 +46,7 @@ public class MiniDetailsGetter extends AbstractDataGetter<VcsCommitMetadata> {
@Override
protected List<? extends VcsCommitMetadata> readDetails(@NotNull VcsLogProvider logProvider, @NotNull VirtualFile root,
@NotNull List<String> hashes) throws VcsException {
return logProvider.readShortDetails(root, hashes);
return logProvider.readMetadata(root, hashes);
}
@NotNull
@@ -141,7 +141,7 @@ public class TestVcsLogProvider implements VcsLogProvider {
@NotNull
@Override
public List<? extends VcsCommitMetadata> readShortDetails(@NotNull VirtualFile root, @NotNull List<String> hashes) {
public List<? extends VcsCommitMetadata> readMetadata(@NotNull VirtualFile root, @NotNull List<String> hashes) {
throw new UnsupportedOperationException();
}
@@ -353,7 +353,7 @@ public class GitLogProvider implements VcsLogProvider {
@NotNull
@Override
public List<? extends VcsCommitMetadata> readShortDetails(@NotNull final VirtualFile root, @NotNull List<String> hashes)
public List<? extends VcsCommitMetadata> readMetadata(@NotNull final VirtualFile root, @NotNull List<String> hashes)
throws VcsException {
return GitLogUtil.collectShortDetails(myProject, myVcs, root, hashes);
}
@@ -240,7 +240,7 @@ public class GitLogProviderTest extends GitSingleRepoTest {
final List<String> hashes = ContainerUtil.newArrayList();
myLogProvider.readAllHashes(projectRoot, timedVcsCommit -> hashes.add(timedVcsCommit.getId().asString()));
List<? extends VcsShortCommitDetails> shortDetails = myLogProvider.readShortDetails(projectRoot, hashes);
List<? extends VcsShortCommitDetails> shortDetails = myLogProvider.readMetadata(projectRoot, hashes);
Function<VcsShortCommitDetails, String> shortDetailsToString = getShortDetailsToString();
assertOrderedEquals(ContainerUtil.map(shortDetails, shortDetailsToString), ContainerUtil.map(log, shortDetailsToString));
@@ -127,7 +127,7 @@ public class HgLogProvider implements VcsLogProvider {
@NotNull
@Override
public List<? extends VcsCommitMetadata> readShortDetails(@NotNull VirtualFile root, @NotNull List<String> hashes)
public List<? extends VcsCommitMetadata> readMetadata(@NotNull VirtualFile root, @NotNull List<String> hashes)
throws VcsException {
return HgHistoryUtil.readCommitMetadata(myProject, root, hashes);
}