mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] sort tags and show the first one, not the random one in the table
This commit is contained in:
+10
-6
@@ -151,8 +151,16 @@ public class GraphCommitCellRenderer extends ColoredTableCellRenderer {
|
||||
}
|
||||
VirtualFile root = refs.iterator().next().getRoot(); // all refs are from the same commit => they have the same root
|
||||
refs = ContainerUtil.sorted(refs, myLogData.getLogProvider(root).getReferenceManager().getLabelsOrderComparator());
|
||||
List<VcsRef> branches = getBranches(refs);
|
||||
Collection<VcsRef> tags = ContainerUtil.subtract(refs, branches);
|
||||
List<VcsRef> branches = ContainerUtil.newArrayList();
|
||||
List<VcsRef> tags = ContainerUtil.newArrayList();
|
||||
refs.forEach(ref -> {
|
||||
if (ref.getType().isBranch()) {
|
||||
branches.add(ref);
|
||||
}
|
||||
else {
|
||||
tags.add(ref);
|
||||
}
|
||||
});
|
||||
return getLabelsForRefs(branches, tags);
|
||||
}
|
||||
|
||||
@@ -186,10 +194,6 @@ public class GraphCommitCellRenderer extends ColoredTableCellRenderer {
|
||||
return labels;
|
||||
}
|
||||
|
||||
private static List<VcsRef> getBranches(Collection<VcsRef> refs) {
|
||||
return ContainerUtil.filter(refs, ref -> ref.getType().isBranch());
|
||||
}
|
||||
|
||||
private static class PaintInfo {
|
||||
private int myWidth;
|
||||
@NotNull private Image myImage;
|
||||
|
||||
Reference in New Issue
Block a user