diff options
Diffstat (limited to 'platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java')
-rw-r--r-- | platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java | 183 |
1 files changed, 118 insertions, 65 deletions
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java index b9f0855c175c..5e01feada2f3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java @@ -23,15 +23,20 @@ import com.intellij.openapi.application.RuntimeInterruptedException; import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.progress.EmptyProgressIndicator; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.DumbAwareRunnable; import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.impl.DirectoryIndexExcludePolicy; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictTracker; @@ -43,6 +48,7 @@ import com.intellij.openapi.vcs.readOnlyHandler.ReadonlyStatusHandlerImpl; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.EditorNotifications; import com.intellij.util.*; @@ -68,8 +74,10 @@ import java.util.concurrent.atomic.AtomicReference; /** * @author max */ -public class ChangeListManagerImpl extends ChangeListManagerEx implements ProjectComponent, ChangeListOwner, JDOMExternalizable, RoamingTypeDisabled { +public class ChangeListManagerImpl extends ChangeListManagerEx implements ProjectComponent, ChangeListOwner, JDOMExternalizable, + RoamingTypeDisabled { public static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.ChangeListManagerImpl"); + private static final String EXCLUDED_CONVERTED_TO_IGNORED_OPTION = "EXCLUDED_CONVERTED_TO_IGNORED"; private final Project myProject; private final VcsConfiguration myConfig; @@ -101,6 +109,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec private final List<CommitExecutor> myExecutors = new ArrayList<CommitExecutor>(); private final IgnoredFilesComponent myIgnoredIdeaLevel; + private boolean myExcludedConvertedToIgnored; private ProgressIndicator myUpdateChangesProgressIndicator; public static final Topic<LocalChangeListsLoadedListener> LISTS_LOADED = new Topic<LocalChangeListsLoadedListener>( @@ -191,6 +200,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec /** * Shows the proposal to delete one or more changelists that were default and became empty. + * * @return true if the changelists have to be deleted, false if not. */ private boolean showRemoveEmptyChangeListsProposal(@NotNull final VcsConfiguration config, @NotNull Collection<LocalChangeList> lists) { @@ -242,7 +252,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec public void unblockModalNotifications() { myModalNotificationsBlocked = false; if (myListsToBeDeleted.isEmpty()) { - return ; + return; } if (showRemoveEmptyChangeListsProposal(myConfig, myListsToBeDeleted)) { for (LocalChangeList list : myListsToBeDeleted) { @@ -261,14 +271,14 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec vcsManager.addVcsListener(myVcsListener); } else { - ((ProjectLevelVcsManagerImpl) vcsManager).addInitializationRequest( + ((ProjectLevelVcsManagerImpl)vcsManager).addInitializationRequest( VcsInitObject.CHANGE_LIST_MANAGER, new DumbAwareRunnable() { - public void run() { - myUpdater.initialized(); - broadcastStateAfterLoad(); - vcsManager.addVcsListener(myVcsListener); - } - }); + public void run() { + myUpdater.initialized(); + broadcastStateAfterLoad(); + vcsManager.addVcsListener(myVcsListener); + } + }); } myConflictTracker.startTracking(); @@ -279,7 +289,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec synchronized (myDataLock) { listCopy = getChangeListsCopy(); } - myProject.getMessageBus().syncPublisher(LISTS_LOADED).processLoadedLists(listCopy); + if (!myProject.isDisposed()) { + myProject.getMessageBus().syncPublisher(LISTS_LOADED).processLoadedLists(listCopy); + } } private void initializeForNewProject() { @@ -297,11 +309,29 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec myIgnoredIdeaLevel.add(IgnoredBeanFactory.ignoreFile(Project.DIRECTORY_STORE_FOLDER + "/workspace.xml", myProject)); } } + if (!Registry.is("ide.hide.excluded.files") && !myExcludedConvertedToIgnored) { + convertExcludedToIgnored(); + myExcludedConvertedToIgnored = true; + } } } }); } + void convertExcludedToIgnored() { + for (DirectoryIndexExcludePolicy policy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(myProject)) { + for (VirtualFile file : policy.getExcludeRootsForProject()) { + addDirectoryToIgnoreImplicitly(file.getPath()); + } + } + + for (Module module : ModuleManager.getInstance(myProject).getModules()) { + for (String url : ModuleRootManager.getInstance(module).getExcludeRootUrls()) { + addDirectoryToIgnoreImplicitly(VfsUtilCore.urlToPath(url)); + } + } + } + public void projectClosed() { ProjectLevelVcsManager.getInstance(myProject).removeVcsListener(myVcsListener); @@ -328,11 +358,12 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec /** * update itself might produce actions done on AWT thread (invoked-after), - * so waiting for its completion on AWT thread is not good - * - * runnable is invoked on AWT thread + * so waiting for its completion on AWT thread is not good runnable is invoked on AWT thread */ - public void invokeAfterUpdate(final Runnable afterUpdate, final InvokeAfterUpdateMode mode, @Nullable final String title, @Nullable final ModalityState state) { + public void invokeAfterUpdate(final Runnable afterUpdate, + final InvokeAfterUpdateMode mode, + @Nullable final String title, + @Nullable final ModalityState state) { myUpdater.invokeAfterUpdate(afterUpdate, mode, title, null, state); } @@ -394,13 +425,13 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec synchronized (myDataLock) { final IgnoredFilesHolder fileHolder = (IgnoredFilesHolder)myComposite.get(FileHolder.HolderType.IGNORED); - for (Iterator<VcsDirtyScope> iterator = scopes.iterator(); iterator.hasNext();) { - final VcsModifiableDirtyScope scope = (VcsModifiableDirtyScope) iterator.next(); + for (Iterator<VcsDirtyScope> iterator = scopes.iterator(); iterator.hasNext(); ) { + final VcsModifiableDirtyScope scope = (VcsModifiableDirtyScope)iterator.next(); final VcsDirtyScopeModifier modifier = scope.getModifier(); if (modifier != null) { fileHolder.notifyVcsStarted(scope.getVcs()); final Iterator<FilePath> filesIterator = modifier.getDirtyFilesIterator(); - for (; filesIterator.hasNext();) { + while (filesIterator.hasNext()) { final FilePath dirtyFile = filesIterator.next(); if ((dirtyFile.getVirtualFile() != null) && isIgnoredFile(dirtyFile.getVirtualFile())) { filesIterator.remove(); @@ -411,7 +442,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec final Collection<VirtualFile> roots = modifier.getAffectedVcsRoots(); for (VirtualFile root : roots) { final Iterator<FilePath> dirIterator = modifier.getDirtyDirectoriesIterator(root); - for (; dirIterator.hasNext(); ) { + while (dirIterator.hasNext()) { final FilePath dir = dirIterator.next(); if ((dir.getVirtualFile() != null) && isIgnoredFile(dir.getVirtualFile())) { dirIterator.remove(); @@ -428,10 +459,10 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } } } - catch(Exception ex) { + catch (Exception ex) { LOG.error(ex); } - catch(AssertionError ex) { + catch (AssertionError ex) { LOG.error(ex); } for (VirtualFile file : refreshFiles) { @@ -443,7 +474,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec final DataHolder dataHolder; final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); - if (! vcsManager.hasActiveVcss()) return; + if (!vcsManager.hasActiveVcss()) return; final VcsInvalidated invalidated = myDirtyScopeManager.retrieveScopes(); if (checkScopeIsEmpty(invalidated)) return; @@ -458,14 +489,14 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec // mark for "modifier" that update started (it would create duplicates of modification commands done by user during update; // after update of copies of objects is complete, it would apply the same modifications to copies.) synchronized (myDataLock) { - dataHolder = new DataHolder((FileHolderComposite) myComposite.copy(), myWorker.copy(), wasEverythingDirty); + dataHolder = new DataHolder((FileHolderComposite)myComposite.copy(), myWorker.copy(), wasEverythingDirty); myModifier.enterUpdate(); if (wasEverythingDirty) { myUpdateException = null; myAdditionalInfo = null; } } - final String scopeInString = (! LOG.isDebugEnabled()) ? "" : StringUtil.join(scopes, new Function<VcsDirtyScope, String>() { + final String scopeInString = (!LOG.isDebugEnabled()) ? "" : StringUtil.join(scopes, new Function<VcsDirtyScope, String>() { @Override public String fun(VcsDirtyScope scope) { return scope.toString(); @@ -504,7 +535,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec myWorker.onAfterWorkerSwitch(oldWorker); myModifier.setWorker(myWorker); LOG.debug("refresh procedure finished, unversioned size: " + - dataHolder.getComposite().getVFHolder(FileHolder.HolderType.UNVERSIONED).getSize() + "\n changes: " + myWorker); + dataHolder.getComposite().getVFHolder(FileHolder.HolderType.UNVERSIONED).getSize() + "\n changes: " + myWorker); final boolean statusChanged = !myComposite.equals(dataHolder.getComposite()); myComposite = dataHolder.getComposite(); if (statusChanged) { @@ -535,19 +566,20 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec catch (DisposedException e) { // OK, we're finishing all the stuff now. } - catch(ProcessCanceledException e) { + catch (ProcessCanceledException e) { // OK, we're finishing all the stuff now. - } catch (RuntimeInterruptedException ignore) { } - catch(Exception ex) { + catch (RuntimeInterruptedException ignore) { + } + catch (Exception ex) { LOG.error(ex); } - catch(AssertionError ex) { + catch (AssertionError ex) { LOG.error(ex); } finally { myDirtyScopeManager.changesProcessed(); - + synchronized (myDataLock) { myDelayedNotificator.getProxyDispatcher().changeListUpdateDone(); myChangesViewManager.scheduleRefresh(); @@ -556,7 +588,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } private boolean checkScopeIsAllIgnored(VcsInvalidated invalidated) { - if (! invalidated.isEverythingDirty()) { + if (!invalidated.isEverythingDirty()) { filterOutIgnoredFiles(invalidated.getScopes()); if (invalidated.isEmpty()) { return true; @@ -586,7 +618,8 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } }; final UpdatingChangeListBuilder builder = new UpdatingChangeListBuilder(dataHolder.getChangeListWorker(), - dataHolder.getComposite(), disposedGetter, myIgnoredIdeaLevel, gate); + dataHolder.getComposite(), disposedGetter, myIgnoredIdeaLevel, + gate); for (final VcsDirtyScope scope : scopes) { myUpdateChangesProgressIndicator.checkCanceled(); @@ -594,7 +627,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec final AbstractVcs vcs = scope.getVcs(); if (vcs == null) continue; scope.setWasEverythingDirty(wasEverythingDirty); - final VcsModifiableDirtyScope adjustedScope = vcs.adjustDirtyScope((VcsModifiableDirtyScope) scope); + final VcsModifiableDirtyScope adjustedScope = vcs.adjustDirtyScope((VcsModifiableDirtyScope)scope); myChangesViewManager.setBusy(true); dataHolder.notifyStartProcessingChanges(adjustedScope); @@ -614,7 +647,8 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec final ContentRevisionCache cache = ProjectLevelVcsManager.getInstance(myProject).getContentRevisionCache(); if (invalidated.isEverythingDirty()) { cache.clearAllCurrent(); - } else { + } + else { cache.clearScope(invalidated.getScopes()); } } @@ -625,6 +659,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec public boolean isCanceled() { return myUpdater.isStopped(); } + @Override public void checkCanceled() { checkIfDisposed(); @@ -651,7 +686,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } public void notifyStartProcessingChanges(@NotNull final VcsModifiableDirtyScope scope) { - if (! myWasEverythingDirty) { + if (!myWasEverythingDirty) { myComposite.cleanAndAdjustScope(scope); myChangeListWorker.notifyStartProcessingChanges(scope); } @@ -661,7 +696,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } public void notifyDoneProcessingChanges() { - if (! myWasEverythingDirty) { + if (!myWasEverythingDirty) { myChangeListWorker.notifyDoneProcessingChanges(myDelayedNotificator.getProxyDispatcher()); } } @@ -695,11 +730,14 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec handleUpdateException(e); } } - } catch (ProcessCanceledException ignore) { - } catch (Throwable t) { + } + catch (ProcessCanceledException ignore) { + } + catch (Throwable t) { LOG.debug(t); Rethrow.reThrowRuntime(t); - } finally { + } + finally { if (!myUpdater.isStopped()) { dataHolder.notifyDoneProcessingChanges(); } @@ -748,8 +786,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } /** - * @deprecated - * this method made equivalent to {@link #getChangeListsCopy()} so to don't be confused by method name, + * @deprecated this method made equivalent to {@link #getChangeListsCopy()} so to don't be confused by method name, * better use {@link #getChangeListsCopy()} */ @NotNull @@ -816,13 +853,14 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec Map<VirtualFile, LogicalLock> getLogicallyLockedFolders() { synchronized (myDataLock) { - return new HashMap<VirtualFile, LogicalLock>(((LogicallyLockedHolder) myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).getMap()); + return new HashMap<VirtualFile, LogicalLock>( + ((LogicallyLockedHolder)myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).getMap()); } } public boolean isLogicallyLocked(final VirtualFile file) { synchronized (myDataLock) { - return ((LogicallyLockedHolder) myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).containsKey(file); + return ((LogicallyLockedHolder)myComposite.get(FileHolder.HolderType.LOGICALLY_LOCKED)).containsKey(file); } } @@ -847,7 +885,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec @Nullable Map<VirtualFile, String> getSwitchedRoots() { synchronized (myDataLock) { - return ((SwitchedFileHolder) myComposite.get(FileHolder.HolderType.ROOT_SWITCH)).getFilesMapCopy(); + return ((SwitchedFileHolder)myComposite.get(FileHolder.HolderType.ROOT_SWITCH)).getFilesMapCopy(); } } @@ -856,7 +894,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec return myUpdateException; } } - + public Factory<JComponent> getAdditionalUpdateInfo() { synchronized (myDataLock) { return myAdditionalInfo; @@ -937,7 +975,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec synchronized (myDataLock) { for (Map.Entry<String, List<Change>> entry : map.entrySet()) { final List<Change> changes = entry.getValue(); - for (Iterator<Change> iterator = changes.iterator(); iterator.hasNext();) { + for (Iterator<Change> iterator = changes.iterator(); iterator.hasNext(); ) { final Change change = iterator.next(); if (getChangeList(change) != null) { // was not actually rolled back @@ -948,7 +986,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } for (String listName : map.keySet()) { final LocalChangeList byName = myWorker.getCopyByName(listName); - if (byName != null && byName.getChanges().isEmpty() && ! byName.isDefault() && ! byName.isReadOnly()) { + if (byName != null && byName.getChanges().isEmpty() && !byName.isDefault() && !byName.isReadOnly()) { myWorker.removeChangeList(listName); } } @@ -1005,15 +1043,14 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } /** - * @deprecated - * better use normal comparison, with equals + * @deprecated better use normal comparison, with equals */ @Nullable public LocalChangeList getIdentityChangeList(Change change) { synchronized (myDataLock) { final List<LocalChangeList> lists = myWorker.getListsCopy(); for (LocalChangeList list : lists) { - for(Change oldChange: list.getChanges()) { + for (Change oldChange : list.getChanges()) { if (oldChange == change) { return list; } @@ -1168,7 +1205,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec if (exceptions.size() > 0) { StringBuilder message = new StringBuilder(VcsBundle.message("error.adding.files.prompt")); - for(VcsException ex: exceptions) { + for (VcsException ex : exceptions) { message.append("\n").append(ex.getMessage()); } Messages.showErrorDialog(myProject, message.toString(), VcsBundle.message("error.adding.files.title")); @@ -1189,7 +1226,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec synchronized (myDataLock) { List<Change> changesToMove = new ArrayList<Change>(); final LocalChangeList defaultList = getDefaultChangeList(); - for(Change change: defaultList.getChanges()) { + for (Change change : defaultList.getChanges()) { final ContentRevision afterRevision = change.getAfterRevision(); if (afterRevision != null) { VirtualFile vFile = afterRevision.getFile().getVirtualFile(); @@ -1208,8 +1245,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec myChangesViewManager.scheduleRefresh(); } - }, InvokeAfterUpdateMode.BACKGROUND_NOT_CANCELLABLE_NOT_AWT, VcsBundle.message("change.lists.manager.add.unversioned"), null); - } else { + }, InvokeAfterUpdateMode.BACKGROUND_NOT_CANCELLABLE_NOT_AWT, VcsBundle.message("change.lists.manager.add.unversioned"), null); + } + else { myChangesViewManager.scheduleRefresh(); } } @@ -1238,8 +1276,8 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec private boolean doCommit(final LocalChangeList changeList, final List<Change> changes, final boolean synchronously) { FileDocumentManager.getInstance().saveAllDocuments(); return new CommitHelper(myProject, changeList, changes, changeList.getName(), - StringUtil.isEmpty(changeList.getComment()) ? changeList.getName() : changeList.getComment(), - new ArrayList<CheckinHandler>(), false, synchronously, NullableFunction.NULL, null).doCommit(); + StringUtil.isEmpty(changeList.getComment()) ? changeList.getName() : changeList.getComment(), + new ArrayList<CheckinHandler>(), false, synchronously, NullableFunction.NULL, null).doCommit(); } public void commitChangesSynchronously(LocalChangeList changeList, List<Change> changes) { @@ -1252,20 +1290,21 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec @SuppressWarnings({"unchecked"}) public void readExternal(Element element) throws InvalidDataException { - if (! myProject.isDefault()) { + if (!myProject.isDefault()) { synchronized (myDataLock) { myIgnoredIdeaLevel.clear(); new ChangeListManagerSerialization(myIgnoredIdeaLevel, myWorker).readExternal(element); - if ((! myWorker.isEmpty()) && getDefaultChangeList() == null) { + if ((!myWorker.isEmpty()) && getDefaultChangeList() == null) { setDefaultChangeList(myWorker.getListsCopy().get(0)); } } + myExcludedConvertedToIgnored = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, EXCLUDED_CONVERTED_TO_IGNORED_OPTION)); myConflictTracker.loadState(element); } } public void writeExternal(Element element) throws WriteExternalException { - if (! myProject.isDefault()) { + if (!myProject.isDefault()) { final IgnoredFilesComponent ignoredFilesComponent; final ChangeListWorker worker; synchronized (myDataLock) { @@ -1273,6 +1312,9 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec worker = myWorker.copy(); } new ChangeListManagerSerialization(ignoredFilesComponent, worker).writeExternal(element); + if (myExcludedConvertedToIgnored) { + JDOMExternalizerUtil.writeField(element, EXCLUDED_CONVERTED_TO_IGNORED_OPTION, String.valueOf(true)); + } myConflictTracker.saveState(element); } } @@ -1316,10 +1358,11 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } if (vf.isDirectory()) { myDirs.add(vf); - } else { + } + else { myFiles.add(vf); } - ++ myCnt; + ++myCnt; } } @@ -1327,7 +1370,8 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject); if (myEveryThing) { vcsDirtyScopeManager.markEverythingDirty(); - } else { + } + else { vcsDirtyScopeManager.filesDirty(myFiles, myDirs); } } @@ -1338,12 +1382,21 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec scheduleUnversionedUpdate(); } + @Override + public void addDirectoryToIgnoreImplicitly(@NotNull String path) { + myIgnoredIdeaLevel.addIgnoredDirectoryImplicitly(path, myProject); + } + + public IgnoredFilesComponent getIgnoredFilesComponent() { + return myIgnoredIdeaLevel; + } + private void scheduleUnversionedUpdate() { final MyDirtyFilesScheduler scheduler = new MyDirtyFilesScheduler(myProject); synchronized (myDataLock) { final VirtualFileHolder unversionedHolder = myComposite.getVFHolder(FileHolder.HolderType.UNVERSIONED); - final IgnoredFilesHolder ignoredHolder = (IgnoredFilesHolder) myComposite.get(FileHolder.HolderType.IGNORED); + final IgnoredFilesHolder ignoredHolder = (IgnoredFilesHolder)myComposite.get(FileHolder.HolderType.IGNORED); scheduler.accept(unversionedHolder.getFiles()); scheduler.accept(ignoredHolder.values()); @@ -1368,7 +1421,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec } private void exchangeWithIgnored(FileHolderComposite composite, VirtualFileHolder vfHolder, List<VirtualFile> unversionedFiles) { - for(VirtualFile file: unversionedFiles) { + for (VirtualFile file : unversionedFiles) { if (isIgnoredFile(file)) { vfHolder.removeFile(file); composite.getIgnoredFileHolder().addFile(file); @@ -1594,11 +1647,11 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec if (freezeReason != null) { if (modalTitle != null) { Messages.showErrorDialog(myProject, freezeReason, modalTitle); - } else { + } + else { VcsBalloonProblemNotifier.showOverChangesView(myProject, freezeReason, MessageType.WARNING); } } return freezeReason != null; } - } |