From 60bccce0a63c6f395d6fa73179b07a5d302f34ef Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Wed, 23 Sep 2015 16:45:33 +0300 Subject: [PATCH] don't show no files for empty change lists IDEA-CR-5051 --- .../vcs/changes/ui/ChangesBrowserChangeListNode.java | 6 ++++-- .../intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserChangeListNode.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserChangeListNode.java index c13227df13a1..0c363faad658 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserChangeListNode.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserChangeListNode.java @@ -56,8 +56,10 @@ public class ChangesBrowserChangeListNode extends ChangesBrowserNode final String freezed = myClManager.isFreezed(); if (freezed != null) { renderer.append(spaceAndThinSpace() + freezed, SimpleTextAttributes.GRAYED_ATTRIBUTES); - } else if (myClManager.isInUpdate()) { - renderer.append(", " + VcsBundle.message("changes.nodetitle.updating"), SimpleTextAttributes.GRAYED_ATTRIBUTES); + } + else if (myClManager.isInUpdate()) { + renderer.append((getCountText().isEmpty() ? spaceAndThinSpace() : ", ") + VcsBundle.message("changes.nodetitle.updating"), + SimpleTextAttributes.GRAYED_ATTRIBUTES); } if (! myChangeListRemoteState.getState()) { renderer.append(spaceAndThinSpace()); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java index c004a5f2308a..77d439e38852 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNode.java @@ -210,9 +210,11 @@ public class ChangesBrowserNode extends DefaultMutableTreeNode { appendCount(renderer); } + @NotNull protected String getCountText() { int count = getCount(); int dirCount = getDirectoryCount(); + if (dirCount == 0 && count == 0) return ""; if (dirCount == 0) { return spaceAndThinSpace() + VcsBundle.message("changes.nodetitle.changecount", count); } @@ -225,7 +227,7 @@ public class ChangesBrowserNode extends DefaultMutableTreeNode { } protected void appendCount(final ColoredTreeCellRenderer renderer) { - final String countText = getCountText(); + String countText = getCountText(); renderer.append(countText, SimpleTextAttributes.GRAYED_ATTRIBUTES); }