removing empty changelists
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 15 Mar 2010 14:59:34 +0000 (17:59 +0300)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 15 Mar 2010 14:59:34 +0000 (17:59 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsConfirmationDialog.java

index e8674f1fa46b73a6639d0db0cffc258b725cfbd1..106ddb7abee18cc1d294592732624c149534517b 100644 (file)
@@ -127,10 +127,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
       public void defaultListChanged(final ChangeList oldDefaultList, ChangeList newDefaultList) {
         if (!ApplicationManager.getApplication().isUnitTestMode() &&
           oldDefaultList instanceof LocalChangeList &&
-          !((LocalChangeList)oldDefaultList).isDefault() &&
           oldDefaultList.getChanges().isEmpty()) {
 
-          SwingUtilities.invokeLater(new Runnable() {
+          invokeAfterUpdate(new Runnable() {
             public void run() {
               switch (config.REMOVE_EMPTY_INACTIVE_CHANGELISTS) {
 
@@ -157,7 +156,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
               }
               removeChangeList((LocalChangeList)oldDefaultList);
             }
-          });
+          }, InvokeAfterUpdateMode.SILENT, null, null);
         }
       }
     });
index a18744763e057dc777fa1e09a0f39492e350a589..149c6c9cb089b38f3b208ad55183e766a2f31f5c 100644 (file)
@@ -75,6 +75,9 @@ public class VcsConfirmationDialog extends OptionsDialog {
   protected Action[] createActions() {
     return new Action[] {
       new AbstractAction(CommonBundle.getYesButtonText()) {
+        {
+          putValue(DEFAULT_ACTION, Boolean.TRUE);
+        }
         public void actionPerformed(ActionEvent e) {
           doOKAction();
         }