diff options
Diffstat (limited to 'platform/vcs-impl/src/com/intellij')
11 files changed, 146 insertions, 105 deletions
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java index 4b7f6baf2616..985f383ecbc6 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable; public class VcsNotifier { private static final NotificationGroup NOTIFICATION_GROUP_ID = NotificationGroup.toolWindowGroup( - "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID); private static final NotificationGroup IMPORTANT_ERROR_NOTIFICATION = new NotificationGroup( "Vcs Important Messages", NotificationDisplayType.STICKY_BALLOON, true); private static final NotificationGroup MINOR_NOTIFICATION = new NotificationGroup( diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java index 8ad034cfee1b..c1d2d0049edb 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,6 @@ import com.intellij.openapi.vcs.VcsBundle; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.swing.*; - class CallbackData { private final static Logger LOG = Logger.getInstance("com.intellij.openapi.vcs.changes.CallbackData"); private final Runnable myCallback; @@ -50,7 +48,7 @@ class CallbackData { return new CallbackData(new Runnable() { public void run() { if (mode.isCallbackOnAwt()) { - SwingUtilities.invokeLater(new Runnable() { + ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { LOG.debug("invokeAfterUpdate: silent wrapper called for project: " + project.getName()); if (project.isDisposed()) return; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesFragmentedDiffPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesFragmentedDiffPanel.java index 731634b85080..53092e6a1369 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesFragmentedDiffPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesFragmentedDiffPanel.java @@ -15,6 +15,7 @@ */ package com.intellij.openapi.vcs.changes; +import com.intellij.codeStyle.CodeStyleFacade; import com.intellij.icons.AllIcons; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; @@ -55,6 +56,7 @@ import com.intellij.util.BeforeAfter; import com.intellij.util.PlatformIcons; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; @@ -152,87 +154,87 @@ public class ChangesFragmentedDiffPanel implements Disposable { private void createNavigateAction() { myNavigateAction = new DumbAwareAction("Edit Source", "Edit Source", AllIcons.Actions.EditSource) { + @Nullable + private OpenFileDescriptor createDescriptor() { + if (myFragmentedContent == null || myFragmentedContent.getFile() == null) return null; + + final DiffPanel panel = myCurrentHorizontal ? myHorizontal : myVertical; + final DiffSideView side = ((DiffPanelImpl)panel).getCurrentSide(); + if (side == null || side.getEditor() == null) return null; + + final boolean isAfter = FragmentSide.SIDE2.equals(side.getSide()); + if (isAfter) { + final LogicalPosition position = side.getEditor().getCaretModel().getLogicalPosition(); + final int line = position.line; + final int converted = myFragmentedContent.getNewConvertor().execute(line); + return new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), converted, position.column); + } + + if (((DiffPanelImpl)panel).getEditor1().getDocument().getTextLength() == 0) { + return new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), 0); + } + + final CaretModel model = side.getEditor().getCaretModel(); + final FragmentList fragments = ((DiffPanelImpl)panel).getFragments(); + final int line = model.getLogicalPosition().line; + //final int offset = side.getEditor().getDocument().getLineStartOffset(line); + final int offset = model.getOffset(); + + BeforeAfter<Integer> current = null; + final List<BeforeAfter<Integer>> ranges = myFragmentedContent.getLineRanges(); + for (BeforeAfter<Integer> range : ranges) { + if (range.getBefore() > line) break; + current = range; + } + if (current == null) return null; + final Fragment at = fragments.getFragmentAt(offset, FragmentSide.SIDE1, Condition.TRUE); + if (at == null) return null; + final TextRange opposite = at.getRange(FragmentSide.SIDE2); + + final int lineInNew = ((DiffPanelImpl)panel).getEditor2().getDocument().getLineNumber(opposite.getStartOffset()); + + int correctLine; + int column; + if (at.getType() == null || TextDiffTypeEnum.NONE.equals(at.getType())) { + column = model.getLogicalPosition().column; + final int startIn1 = + ((DiffPanelImpl)panel).getEditor1().getDocument().getLineNumber(at.getRange(FragmentSide.SIDE1).getStartOffset()); + correctLine = lineInNew + line - startIn1; + } + else { + column = 0; + correctLine = Math.max(lineInNew, current.getAfter()); + } + + int converted = myFragmentedContent.getNewConvertor().execute(correctLine); + return new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), converted, column); + } + @Override public void actionPerformed(AnActionEvent e) { - final boolean enabled = getEnabled(); - if (enabled) { - OpenFileDescriptor descriptor = null; - if (myFragmentedContent != null && myFragmentedContent.getFile() != null) { - final DiffPanel panel = myCurrentHorizontal ? myHorizontal : myVertical; - - final DiffSideView side = ((DiffPanelImpl)panel).getCurrentSide(); - if (side == null || side.getEditor() == null) return; - - final boolean isAfter = FragmentSide.SIDE2.equals(side.getSide()); - if (isAfter) { - final LogicalPosition position = side.getEditor().getCaretModel().getLogicalPosition(); - final int line = position.line; - final int converted = myFragmentedContent.getNewConvertor().execute(line); - descriptor = new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), converted, position.column); - } else { - if (((DiffPanelImpl) panel).getEditor1().getDocument().getTextLength() == 0) { - FileEditorManager.getInstance(myProject).openTextEditor(new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), 0), - true); - return; - } - - final CaretModel model = side.getEditor().getCaretModel(); - final FragmentList fragments = ((DiffPanelImpl)panel).getFragments(); - final int line = model.getLogicalPosition().line; - //final int offset = side.getEditor().getDocument().getLineStartOffset(line); - final int offset = model.getOffset(); - - BeforeAfter<Integer> current = null; - final List<BeforeAfter<Integer>> ranges = myFragmentedContent.getLineRanges(); - for (BeforeAfter<Integer> range : ranges) { - if (range.getBefore() > line) break; - current = range; - } - if (current == null) return; - final Fragment at = fragments.getFragmentAt(offset, FragmentSide.SIDE1, Condition.TRUE); - if (at == null) return; - final TextRange opposite = at.getRange(FragmentSide.SIDE2); - - final int lineInNew = ((DiffPanelImpl)panel).getEditor2().getDocument().getLineNumber(opposite.getStartOffset()); - - int correctLine; - int column; - if (at.getType() == null || TextDiffTypeEnum.NONE.equals(at.getType())) { - column = model.getLogicalPosition().column; - final int startIn1 = - ((DiffPanelImpl)panel).getEditor1().getDocument().getLineNumber(at.getRange(FragmentSide.SIDE1).getStartOffset()); - correctLine = lineInNew + line - startIn1; - } - else { - column = 0; - correctLine = Math.max(lineInNew, current.getAfter()); - } - - int converted = myFragmentedContent.getNewConvertor().execute(correctLine); - descriptor = new OpenFileDescriptor(myProject, myFragmentedContent.getFile(), converted, column); - } + if (!getEnabled()) return; + final OpenFileDescriptor descriptor = createDescriptor(); + if (descriptor == null) return; + + final Runnable runnable = new Runnable() { + @Override + public void run() { + FileEditorManager.getInstance(myProject).openTextEditor(descriptor, true); } - if (descriptor == null) return; - final OpenFileDescriptor finalDescriptor = descriptor; - final Runnable runnable = new Runnable() { - @Override - public void run() { - FileEditorManager.getInstance(myProject).openTextEditor(finalDescriptor, true); - } - }; - if (! ModalityState.NON_MODAL.equals(ModalityState.current())) { - final Window window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); - if (window instanceof DialogWrapperDialog) { - final DialogWrapper wrapper = ((DialogWrapperDialog)window).getDialogWrapper(); - if (wrapper != null) { - Disposer.dispose(wrapper.getDisposable()); - wrapper.close(DialogWrapper.CANCEL_EXIT_CODE); - ApplicationManager.getApplication().invokeLater(runnable, ModalityState.NON_MODAL, myProject.getDisposed()); - return; - } + }; + + if (ModalityState.NON_MODAL.equals(ModalityState.current())) { + runnable.run(); + } + else { + final Window window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); + if (window instanceof DialogWrapperDialog) { + final DialogWrapper wrapper = ((DialogWrapperDialog)window).getDialogWrapper(); + if (wrapper != null) { + wrapper.doCancelAction(); + ApplicationManager.getApplication().invokeLater(runnable, ModalityState.NON_MODAL, myProject.getDisposed()); } } - runnable.run(); } } @@ -280,15 +282,25 @@ public class ChangesFragmentedDiffPanel implements Disposable { myTitleLabel.setText(titleText((DiffPanelImpl)currentPanel)); myLeftLines = state.getLeftLines(); + EditorEx hEditor1 = (EditorEx)((DiffPanelImpl)myHorizontal).getEditor1(); + EditorEx vEditor1 = (EditorEx)((DiffPanelImpl)myVertical).getEditor1(); + EditorEx hEditor2 = (EditorEx)((DiffPanelImpl)myHorizontal).getEditor2(); + EditorEx vEditor2 = (EditorEx)((DiffPanelImpl)myVertical).getEditor2(); + + assert hEditor1 != null; + assert vEditor1 != null; + assert hEditor2 != null; + assert vEditor2 != null; + FragmentedEditorHighlighter bh = fragmentedContent.getBeforeHighlighter(); if (bh != null) { - ((EditorEx) ((DiffPanelImpl) myHorizontal).getEditor1()).setHighlighter(bh); - ((EditorEx) ((DiffPanelImpl) myVertical).getEditor1()).setHighlighter(bh); + hEditor1.setHighlighter(bh); + vEditor1.setHighlighter(bh); } FragmentedEditorHighlighter ah = fragmentedContent.getAfterHighlighter(); if (ah != null) { - ((EditorEx) ((DiffPanelImpl) myHorizontal).getEditor2()).setHighlighter(ah); - ((EditorEx) ((DiffPanelImpl) myVertical).getEditor2()).setHighlighter(ah); + hEditor2.setHighlighter(ah); + vEditor2.setHighlighter(ah); } if (((DiffPanelImpl) currentPanel).getEditor1() != null) { highlightTodo(true, fragmentedContent.getBeforeTodoRanges()); @@ -296,6 +308,19 @@ public class ChangesFragmentedDiffPanel implements Disposable { if (((DiffPanelImpl) currentPanel).getEditor2() != null) { highlightTodo(false, fragmentedContent.getAfterTodoRanges()); } + if (fragmentedContent.getFileType() != null && myProject != null && !myProject.isDisposed()) { + CodeStyleFacade codeStyleFacade = CodeStyleFacade.getInstance(myProject); + int tabSize = codeStyleFacade.getTabSize(fragmentedContent.getFileType()); + boolean useTabCharacter = codeStyleFacade.useTabCharacter(fragmentedContent.getFileType()); + hEditor1.getSettings().setTabSize(tabSize); + vEditor1.getSettings().setTabSize(tabSize); + hEditor2.getSettings().setTabSize(tabSize); + vEditor2.getSettings().setTabSize(tabSize); + hEditor1.getSettings().setUseTabCharacter(useTabCharacter); + vEditor1.getSettings().setUseTabCharacter(useTabCharacter); + hEditor2.getSettings().setUseTabCharacter(useTabCharacter); + vEditor2.getSettings().setUseTabCharacter(useTabCharacter); + } ensurePresentation(); softWraps(myConfiguration.SOFT_WRAPS_IN_SHORT_DIFF); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/PreparedFragmentedContent.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/PreparedFragmentedContent.java index 6e8a1a04d135..2722239d33b7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/PreparedFragmentedContent.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/PreparedFragmentedContent.java @@ -398,4 +398,8 @@ public class PreparedFragmentedContent { public VirtualFile getFile() { return myFile; } + + public FileType getFileType() { + return myFileType; + } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcessor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcessor.java index cb073e2c129b..f060cca6368f 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcessor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcessor.java @@ -19,6 +19,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.application.impl.ApplicationImpl; import com.intellij.openapi.components.RoamingType; +import com.intellij.openapi.components.StoragePathMacros; import com.intellij.openapi.components.impl.stores.StorageUtil; import com.intellij.openapi.components.impl.stores.StreamProvider; import com.intellij.openapi.diagnostic.Logger; @@ -36,6 +37,8 @@ import java.util.Collections; import java.util.List; public class CompoundShelfFileProcessor { + public static final String SHELF_DIR_NAME = "shelf"; + private final String mySubdirName; private final StreamProvider myServerStreamProvider; private final String FILE_SPEC; @@ -43,19 +46,20 @@ public class CompoundShelfFileProcessor { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.shelf.CompoundShelfFileProcessor"); - public CompoundShelfFileProcessor(final String subdirName) { - mySubdirName = subdirName; - myServerStreamProvider = ((ApplicationImpl)ApplicationManager.getApplication()).getStateStore().getStateStorageManager().getStreamProvider(); + public CompoundShelfFileProcessor() { + this(PathManager.getConfigPath()); + } - FILE_SPEC = "$ROOT_CONFIG$/" + subdirName + "/"; - myShelfPath = PathManager.getConfigPath() + File.separator + mySubdirName; + public CompoundShelfFileProcessor(String shelfBaseDirPath) { + this(((ApplicationImpl)ApplicationManager.getApplication()).getStateStore().getStateStorageManager().getStreamProvider(), + shelfBaseDirPath + File.separator + SHELF_DIR_NAME); } public CompoundShelfFileProcessor(@Nullable StreamProvider serverStreamProvider, String shelfPath) { myServerStreamProvider = serverStreamProvider; myShelfPath = shelfPath; mySubdirName = new File(myShelfPath).getName(); - FILE_SPEC = "$ROOT_CONFIG$/" + mySubdirName + "/"; + FILE_SPEC = StoragePathMacros.ROOT_CONFIG + "/" + mySubdirName + "/"; } /* @@ -150,7 +154,7 @@ public class CompoundShelfFileProcessor { if (stream != null) { File file = new File(myShelfPath + "/" + newName); copyFileToStream(stream, file); - serverStreamProvider.deleteFile(oldFilePath, RoamingType.PER_USER); + serverStreamProvider.delete(oldFilePath, RoamingType.PER_USER); copyFileContentToProviders(newFilePath, serverStreamProvider, file); } } @@ -221,7 +225,7 @@ public class CompoundShelfFileProcessor { public void delete(final String name) { FileUtil.delete(new File(getBaseIODir(), name)); if (myServerStreamProvider != null && myServerStreamProvider.isEnabled()) { - StorageUtil.deleteContent(myServerStreamProvider, FILE_SPEC + name, RoamingType.PER_USER); + StorageUtil.delete(myServerStreamProvider, FILE_SPEC + name, RoamingType.PER_USER); } } }
\ No newline at end of file diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfManagerConfigurationMerger.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfManagerConfigurationMerger.java index bfaead47ab3a..b05cc9067592 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfManagerConfigurationMerger.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelfManagerConfigurationMerger.java @@ -35,7 +35,7 @@ public class ShelfManagerConfigurationMerger implements XmlConfigurationMerger { public ShelfManagerConfigurationMerger() { myConfigPath = PathManager.getConfigPath()+ "/shelf"; - myFileProcessor = new CompoundShelfFileProcessor("shelf"); + myFileProcessor = new CompoundShelfFileProcessor(); } @TestOnly diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java index e76ba194672e..96bb835bc086 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java @@ -26,6 +26,7 @@ import com.intellij.lifecycle.PeriodicalTasksCloser; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.components.AbstractProjectComponent; +import com.intellij.openapi.components.StorageScheme; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.impl.patch.*; import com.intellij.openapi.diff.impl.patch.apply.ApplyFilePatchBase; @@ -34,6 +35,7 @@ import com.intellij.openapi.diff.impl.patch.formove.PatchApplier; import com.intellij.openapi.progress.AsynchronousExecution; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; +import com.intellij.openapi.project.ex.ProjectEx; import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.FileUtilRt; @@ -65,6 +67,8 @@ import javax.swing.event.ChangeListener; import java.io.*; import java.util.*; +import static com.intellij.openapi.vcs.changes.shelf.CompoundShelfFileProcessor.SHELF_DIR_NAME; + public class ShelveChangesManager extends AbstractProjectComponent implements JDOMExternalizable { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager"); @@ -86,10 +90,16 @@ public class ShelveChangesManager extends AbstractProjectComponent implements JD super(project); myBus = bus; if (project.isDefault()) { - myFileProcessor = new CompoundShelfFileProcessor(null, PathManager.getConfigPath() + File.separator + "shelf"); + myFileProcessor = new CompoundShelfFileProcessor(null, PathManager.getConfigPath() + File.separator + SHELF_DIR_NAME); } else { - myFileProcessor = new CompoundShelfFileProcessor("shelf"); + if (project instanceof ProjectEx && ((ProjectEx)project).getStateStore().getStorageScheme() == StorageScheme.DIRECTORY_BASED) { + String shelfBaseDirPath = project.getBaseDir().getPath() + File.separator + Project.DIRECTORY_STORE_FOLDER; + myFileProcessor = new CompoundShelfFileProcessor(shelfBaseDirPath); + } + else { + myFileProcessor = new CompoundShelfFileProcessor(); + } } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java index 8d5463cd444b..57229c3fdf18 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeAnalysisBeforeCheckinHandler.java @@ -30,14 +30,12 @@ import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.VcsConfiguration; import com.intellij.openapi.vcs.changes.CommitExecutor; import com.intellij.openapi.vcs.ui.RefreshableOnComponent; -import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.PairConsumer; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; -import java.util.ArrayList; import java.util.List; /** @@ -139,7 +137,8 @@ public class CodeAnalysisBeforeCheckinHandler extends CheckinHandler { try { final List<CodeSmellInfo> codeSmells = - CodeSmellDetector.getInstance(myProject).findCodeSmells(new ArrayList<VirtualFile>(myCheckinPanel.getVirtualFiles())); + CodeSmellDetector.getInstance(myProject) + .findCodeSmells(CheckinHandlerUtil.filterOutGeneratedAndExcludedFiles(myCheckinPanel.getVirtualFiles(), myProject)); if (!codeSmells.isEmpty()) { return processFoundCodeSmells(codeSmells, executor); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeCleanupCheckinHandlerFactory.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeCleanupCheckinHandlerFactory.java index 97e9e4d1b534..b80936aafa14 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeCleanupCheckinHandlerFactory.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CodeCleanupCheckinHandlerFactory.java @@ -24,10 +24,12 @@ import com.intellij.openapi.vcs.CheckinProjectPanel; import com.intellij.openapi.vcs.VcsConfiguration; import com.intellij.openapi.vcs.changes.CommitContext; import com.intellij.openapi.vcs.ui.RefreshableOnComponent; +import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; +import java.util.List; public class CodeCleanupCheckinHandlerFactory extends CheckinHandlerFactory { @@ -75,7 +77,8 @@ public class CodeCleanupCheckinHandlerFactory extends CheckinHandlerFactory { public void runCheckinHandlers(Runnable runnable) { if (VcsConfiguration.getInstance(myProject).CHECK_CODE_CLEANUP_BEFORE_PROJECT_COMMIT && !DumbService.isDumb(myProject)) { - GlobalInspectionContextBase.codeCleanup(myProject, new AnalysisScope(myProject, myPanel.getVirtualFiles()), runnable); + List<VirtualFile> filesToProcess = CheckinHandlerUtil.filterOutGeneratedAndExcludedFiles(myPanel.getVirtualFiles(), myProject); + GlobalInspectionContextBase.codeCleanup(myProject, new AnalysisScope(myProject, filesToProcess), runnable); } else { runnable.run(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java index 9d8d73a92be9..daef43857c4e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,13 +39,11 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; import com.intellij.openapi.vcs.history.VcsRevisionNumber; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.EditorNotificationPanel; -import com.intellij.util.ExceptionUtil; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.diff.FilesTooBigForDiffException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.swing.*; import java.util.*; /** @@ -459,7 +457,7 @@ public class LineStatusTracker { } if (myRanges.isEmpty() && myVirtualFile != null) { - SwingUtilities.invokeLater(new Runnable() { + ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { FileDocumentManager.getInstance().saveDocument(myDocument); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java index 908a3d9f8433..82ff0bcc6e5a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java @@ -37,7 +37,7 @@ import javax.swing.event.HyperlinkEvent; */ public class VcsBalloonProblemNotifier implements Runnable { public static final NotificationGroup - NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID); private final Project myProject; private final String myMessage; private final MessageType myMessageType; |