diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 6b1ac3c4dc99..7292629cf3d0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -266,6 +266,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme @NotNull private static String getPresentableText(@NotNull VcsFileRevision revision, boolean withMessage) { + // implementation reflected by com.intellij.vcs.log.ui.frame.VcsLogGraphTable.getPresentableText() StringBuilder sb = new StringBuilder(); sb.append(FileHistoryPanelImpl.RevisionColumnInfo.toString(revision, true)).append(" "); sb.append(revision.getAuthor()); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java index b422372d8372..e20826b55245 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java @@ -26,6 +26,7 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.ui.LoadingDecorator; import com.intellij.openapi.ui.popup.Balloon; +import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Couple; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; @@ -284,7 +285,7 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider, if (log == null) return; List details = VcsLogUtil.collectFirstPackOfLoadedSelectedDetails(log); if (details.isEmpty()) return; - String text = StringUtil.join(details, VcsLogGraphTable::getTextForClipboard, "\n"); + String text = StringUtil.join(details, commit -> getPresentableText(commit, true), "\n"); CopyPasteManager.getInstance().setContents(new StringSelection(text)); } @@ -294,8 +295,20 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider, } @NotNull - private static String getTextForClipboard(@NotNull VcsFullCommitDetails commit) { - return commit.getId().toShortString() + " " + commit.getSubject(); + private static String getPresentableText(@NotNull VcsFullCommitDetails commit, boolean withMessage) { + // implementation reflected by com.intellij.openapi.vcs.history.FileHistoryPanelImpl.getPresentableText() + StringBuilder sb = new StringBuilder(); + sb.append(commit.getId().toShortString()).append(" "); + sb.append(commit.getAuthor().getName()); + long time = commit.getAuthorTime(); + sb.append(" on ").append(DateFormatUtil.formatDate(time)).append(" at ").append(DateFormatUtil.formatTime(time)); + if (!Comparing.equal(commit.getAuthor(), commit.getCommitter())) { + sb.append(" (committed by ").append(commit.getCommitter().getName()).append(")"); + } + if (withMessage) { + sb.append(" ").append(commit.getSubject()); + } + return sb.toString(); } @Override