diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index ebb001f7270a..b639490e7cc2 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -303,7 +303,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj handler.includedChangesChanged(); } } - }) { + }, myShowVcsCommit) { @Override protected void afterDiffRefresh() { myBrowser.rebuildList(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java index 872b86fb67d7..01e8cd1c133a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java @@ -58,6 +58,7 @@ public class MultipleChangeListBrowser extends ChangesBrowserBase { @NotNull private final EventDispatcher myDispatcher = EventDispatcher.create(SelectedListChangeListener.class); @Nullable private final Runnable myRebuildListListener; + private final boolean myShowUnversioned; private Collection myAllChanges; private boolean myInRebuildList; @@ -69,10 +70,12 @@ public class MultipleChangeListBrowser extends ChangesBrowserBase { boolean capableOfExcludingChanges, boolean highlightProblems, @Nullable Runnable rebuildListListener, - @Nullable Runnable inclusionListener) { + @Nullable Runnable inclusionListener, + boolean showUnversioned) { super(project, changeLists, changes, initialListSelection, capableOfExcludingChanges, highlightProblems, inclusionListener, ChangesBrowser.MyUseCase.LOCAL_CHANGES, null, Object.class); myRebuildListListener = rebuildListListener; + myShowUnversioned = showUnversioned; myChangeListChooser = new ChangeListChooser(changeLists); myHeaderPanel.add(myChangeListChooser, BorderLayout.EAST); @@ -177,12 +180,14 @@ public class MultipleChangeListBrowser extends ChangesBrowserBase { ChangeListManagerImpl manager = ChangeListManagerImpl.getInstanceImpl(myProject); TreeModelBuilder builder = new TreeModelBuilder(myProject, showFlatten); - return builder - .setChanges(findChanges(objects), changeNodeDecorator) + builder.setChanges(findChanges(objects), changeNodeDecorator); + if (myShowUnversioned) { // TODO: Currently we do not support ChangesBrowserManyUnversionedFilesNode here - and so explicitly set "0" to // TODO: 2nd and 3rd values. - .setUnversioned(Trinity.create(manager.getUnversionedFiles(), 0, 0)) - .build(); + builder.setUnversioned(Trinity.create(manager.getUnversionedFiles(), 0, 0)); + } + + return builder.build(); } @NotNull @@ -191,7 +196,7 @@ public class MultipleChangeListBrowser extends ChangesBrowserBase { List result = ContainerUtil.newArrayList(); result.addAll(node.getAllChangesUnder()); - if (isUnderUnversioned(node)) { + if (myShowUnversioned && isUnderUnversioned(node)) { result.addAll(node.getAllFilesUnder()); } @@ -204,7 +209,7 @@ public class MultipleChangeListBrowser extends ChangesBrowserBase { Object result = null; Object userObject = node.getUserObject(); - if (userObject instanceof Change || isUnderUnversioned(node) && userObject instanceof VirtualFile) { + if (userObject instanceof Change || myShowUnversioned && isUnderUnversioned(node) && userObject instanceof VirtualFile) { result = userObject; }