LabelsAndColor (@NotNull RevisionItem item) { Revision r = item.revision; final Pair<List<String>, Integer> affected = r.getAffectedFileNames(); String title = r.getChangeSetName(); boolean named = title != null; if (title == null) { title = StringUtil.join(affected.first, ", "); if (affected.first.size() < affected.second) title += "..."; } String filesCount = LocalHistoryBundle.message("revisions.table.filesCount", affected.second); Pair<@NlsContexts.Label String, Color> label = null; if (!item.labels.isEmpty()) { Revision first = item.labels.getFirst(); label = Pair.create(first.getLabel(), first.getLabelColor() == -1 ? USER_LABEL_COLOR : new Color(first.getLabelColor())); } return new LabelsAndColor(named, title, filesCount, label); }