use of com.intellij.vcs.log.VcsFullCommitDetails in project intellij-community by JetBrains.
the class GitNewResetDialog method prepareDescription.
@NotNull
private static String prepareDescription(@NotNull Project project, @NotNull Map<GitRepository, VcsFullCommitDetails> commits) {
if (commits.size() == 1 && !isMultiRepo(project)) {
Map.Entry<GitRepository, VcsFullCommitDetails> entry = commits.entrySet().iterator().next();
return String.format("%s -> %s", getSourceText(entry.getKey()), getTargetText(entry.getValue()));
}
StringBuilder desc = new StringBuilder("");
for (Map.Entry<GitRepository, VcsFullCommitDetails> entry : commits.entrySet()) {
GitRepository repository = entry.getKey();
VcsFullCommitDetails commit = entry.getValue();
desc.append(String.format("%s in %s -> %s<br/>", getSourceText(repository), getShortRepositoryName(repository), getTargetText(commit)));
}
return desc.toString();
}
use of com.intellij.vcs.log.VcsFullCommitDetails in project intellij-community by JetBrains.
the class HgQGotoFromLogAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
VcsLog log = e.getRequiredData(VcsLogDataKeys.VCS_LOG);
log.requestSelectedDetails(new Consumer<List<VcsFullCommitDetails>>() {
@Override
public void consume(List<VcsFullCommitDetails> selectedDetails) {
VcsFullCommitDetails fullCommitDetails = ContainerUtil.getFirstItem(selectedDetails);
assert fullCommitDetails != null;
final HgRepository repository = getRepositoryForRoot(project, fullCommitDetails.getRoot());
assert repository != null;
actionPerformed(repository, fullCommitDetails);
}
}, null);
}
Aggregations