summaryrefslogtreecommitdiff
path: root/platform/vcs-impl
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-01 12:55:43 -0700
committerTor Norbye <tnorbye@google.com>2013-05-01 12:55:43 -0700
commit8fb0021093e7d978cc06043ba4c06b0a47778294 (patch)
treeb95f5f920574415ae49b26ad6abac86eb6d7b38d /platform/vcs-impl
parentb17587c84879dd2ea42495f1fbdadbc806b9475b (diff)
downloadidea-8fb0021093e7d978cc06043ba4c06b0a47778294.tar.gz
Snapshot dddb119296e7ee16fa8180784610b89b89112ebb from master branch of git://git.jetbrains.org/idea/community.git
Change-Id: I5fe892d3e4d06009445cc2270aa90bb57dea9d39
Diffstat (limited to 'platform/vcs-impl')
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffTableModel.java12
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FragmentedDiffRequestFromChange.java7
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java58
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java2
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerImpl.java16
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequest.java1
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequestPresentable.java2
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java2
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java12
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/SelectFilesDialog.java16
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java2
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java16
-rw-r--r--platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java15
13 files changed, 108 insertions, 53 deletions
diff --git a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffTableModel.java b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffTableModel.java
index e2c10a067478..1ac6b8b7e46c 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffTableModel.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/dir/DirDiffTableModel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
@@ -223,10 +223,12 @@ public class DirDiffTableModel extends AbstractTableModel implements DirDiffMode
reportException(VcsBundle.message("refresh.failed.message", StringUtil.decapitalize(e.getLocalizedMessage())));
}
finally {
- myTree.setSource(mySrc);
- myTree.setTarget(myTrg);
- myTree.update(mySettings);
- applySettings();
+ if (myTree != null) {
+ myTree.setSource(mySrc);
+ myTree.setTarget(myTrg);
+ myTree.update(mySettings);
+ applySettings();
+ }
}
}
});
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FragmentedDiffRequestFromChange.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FragmentedDiffRequestFromChange.java
index 2a510a6f239d..534b0c82f635 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FragmentedDiffRequestFromChange.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FragmentedDiffRequestFromChange.java
@@ -18,6 +18,7 @@ package com.intellij.openapi.vcs.changes;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.diff.impl.ComparisonPolicy;
+import com.intellij.openapi.diff.impl.external.DiffManagerImpl;
import com.intellij.openapi.diff.impl.fragments.LineFragment;
import com.intellij.openapi.diff.impl.highlighting.FragmentSide;
import com.intellij.openapi.diff.impl.processing.TextCompareProcessor;
@@ -140,7 +141,11 @@ public class FragmentedDiffRequestFromChange {
}
}
- final TextCompareProcessor processor = new TextCompareProcessor(ComparisonPolicy.DEFAULT);
+ ComparisonPolicy comparisonPolicy = DiffManagerImpl.getInstanceEx().getComparisonPolicy();
+ if (comparisonPolicy == null) {
+ comparisonPolicy = ComparisonPolicy.DEFAULT;
+ }
+ final TextCompareProcessor processor = new TextCompareProcessor(comparisonPolicy);
final ArrayList<LineFragment> lineFragments = processor.process(myOldDocument.getText(), myDocument.getText());
myRanges = new ArrayList<BeforeAfter<TextRange>>(lineFragments.size());
for (LineFragment lineFragment : lineFragments) {
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java
index 8a672edfbca3..7fbe5e04aac7 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java
@@ -21,6 +21,8 @@ import com.intellij.ide.TreeExpander;
import com.intellij.ide.util.treeView.TreeState;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.AnActionListener;
+import com.intellij.openapi.actionSystem.impl.PresentationFactory;
+import com.intellij.openapi.actionSystem.impl.Utils;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.project.DumbAware;
@@ -42,6 +44,7 @@ import javax.swing.*;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.awt.*;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
@@ -119,35 +122,16 @@ public class UnversionedViewDialog extends DialogWrapper {
actions.add(collapseAction);
actions.add(new ToggleShowFlattenAction());
- AnAction addAction = ActionManager.getInstance().getAction("ChangesView.AddUnversioned.From.Dialog");
- AnAction moveAction = ActionManager.getInstance().getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST);
- AnAction deleteAction = ActionManager.getInstance().getAction("ChangesView.DeleteUnversioned.From.Dialog");
- AnAction ignoreAction = ActionManager.getInstance().getAction("ChangesView.Ignore");
-
- final AnAction[] operatingActions = { addAction, moveAction, deleteAction, ignoreAction };
-
- for (AnAction action : operatingActions) {
- actions.add(action);
- action.registerCustomShortcutSet(action.getShortcutSet(), myView);
- }
- deleteAction.registerCustomShortcutSet(CommonShortcuts.DELETE, myView); // special shortcut for deleting file
+ final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("UNVERSIONED_DIALOG", group, false);
- ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
- @Override
- public void afterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
- for (AnAction anAction : operatingActions) {
- if (anAction.equals(action)) {
- refreshView();
- return;
- }
- }
- }
- }, myDisposable);
+ final ActionGroup operatingActions = (ActionGroup)ActionManager.getInstance().getAction("Unversioned.Files.Dialog");
+ registerShortcuts(operatingActions, actionToolbar.getToolbarDataContext());
+ refreshViewAfterActionPerformed(operatingActions);
+ actions.add(operatingActions);
for (AnAction action : actions) {
group.add(action);
}
- final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("UNVERSIONED_DIALOG", group, false);
myPanel.add(actionToolbar.getComponent(), BorderLayout.WEST);
myPanel.add(ScrollPaneFactory.createScrollPane(myView), BorderLayout.CENTER);
@@ -160,6 +144,32 @@ public class UnversionedViewDialog extends DialogWrapper {
myView.setShowFlatten(false);
}
+ private void registerShortcuts(@NotNull ActionGroup opActionGroup, @NotNull DataContext dataContext) {
+ List<AnAction> opActions = new ArrayList<AnAction>();
+ Utils.expandActionGroup(opActionGroup, opActions, new PresentationFactory(), dataContext, "", ActionManager.getInstance());
+ for (AnAction action : opActions) {
+ action.registerCustomShortcutSet(action.getShortcutSet(), myView);
+ }
+
+ // special shortcut for deleting a file
+ AnAction deleteAction = ActionManager.getInstance().getAction("ChangesView.DeleteUnversioned.From.Dialog");
+ deleteAction.registerCustomShortcutSet(CommonShortcuts.DELETE, myView);
+ }
+
+ private void refreshViewAfterActionPerformed(@NotNull final ActionGroup opActionGroup) {
+ ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
+ @Override
+ public void afterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
+ for (AnAction anAction : opActionGroup.getChildren(event)) {
+ if (anAction.equals(action)) {
+ refreshView();
+ return;
+ }
+ }
+ }
+ }, myDisposable);
+ }
+
@Override
protected String getDimensionServiceKey() {
return "com.intellij.openapi.vcs.changes.UnversionedViewDialog";
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java
index 394484e360aa..8c820b7677ac 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java
@@ -267,7 +267,7 @@ public class VcsChangeDetailsManager {
}
private static JPanel noDifferences() {
- return UIVcsUtil.errorPanel(DiffBundle.message("diff.contents.have.differences.only.in.line.separators.message.text"), false);
+ return UIVcsUtil.errorPanel(DiffBundle.message("diff.contents.have.differences.only.in.line.separators.or.whitespaces"), false);
}
private static class FragmentedDiffDetailsProvider implements VcsChangeDetailsProvider {
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerImpl.java
index 8ffa72209ea7..a5d4a011ae42 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerImpl.java
@@ -30,10 +30,10 @@ import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsRoot;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
+import com.intellij.util.ReflectionUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import sun.reflect.Reflection;
import java.util.ArrayList;
import java.util.Collection;
@@ -105,7 +105,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
if ((! myProject.isOpen()) || myProject.isDisposed() || myVcsManager.getAllActiveVcss().length == 0) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("everything dirty: " + Reflection.getCallerClass(1));
+ LOG.debug("everything dirty: " + ReflectionUtil.getCallerClass(1));
}
final LifeDrop lifeDrop = myLife.doIfAlive(new Runnable() {
@@ -169,7 +169,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
if (! haveStuff) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("paths dirty: " + filesConverted + "; " + dirsConverted + "; " + Reflection.getCallerClass(2));
+ LOG.debug("paths dirty: " + filesConverted + "; " + dirsConverted + "; " + ReflectionUtil.getCallerClass(2));
}
takeDirt(new Consumer<DirtBuilder>() {
@@ -231,7 +231,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
if (! haveStuff) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("files dirty: " + filesConverted + "; " + dirsConverted + "; " + Reflection.getCallerClass(2));
+ LOG.debug("files dirty: " + filesConverted + "; " + dirsConverted + "; " + ReflectionUtil.getCallerClass(2));
}
takeDirt(new Consumer<DirtBuilder>() {
@@ -257,7 +257,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
final AbstractVcs vcs = myGuess.getVcsForDirty(file);
if (vcs == null) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("file dirty: " + file + "; " + Reflection.getCallerClass(2));
+ LOG.debug("file dirty: " + file + "; " + ReflectionUtil.getCallerClass(2));
}
final VcsRoot root = new VcsRoot(vcs, file);
takeDirt(new Consumer<DirtBuilder>() {
@@ -274,7 +274,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
final AbstractVcs vcs = myGuess.getVcsForDirty(file);
if (vcs == null) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("file dirty: " + file + "; " + Reflection.getCallerClass(1));
+ LOG.debug("file dirty: " + file + "; " + ReflectionUtil.getCallerClass(1));
}
final FilePathUnderVcs root = new FilePathUnderVcs(file, vcs);
takeDirt(new Consumer<DirtBuilder>() {
@@ -295,7 +295,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
final AbstractVcs vcs = myGuess.getVcsForDirty(dir);
if (vcs == null) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("dir dirty recursively: " + dir + "; " + Reflection.getCallerClass(2));
+ LOG.debug("dir dirty recursively: " + dir + "; " + ReflectionUtil.getCallerClass(2));
}
final VcsRoot root = new VcsRoot(vcs, dir);
takeDirt(new Consumer<DirtBuilder>() {
@@ -312,7 +312,7 @@ public class VcsDirtyScopeManagerImpl extends VcsDirtyScopeManager implements Pr
final AbstractVcs vcs = myGuess.getVcsForDirty(path);
if (vcs == null) return;
if (LOG.isDebugEnabled()) {
- LOG.debug("dir dirty recursively: " + path + "; " + Reflection.getCallerClass(2));
+ LOG.debug("dir dirty recursively: " + path + "; " + ReflectionUtil.getCallerClass(2));
}
final FilePathUnderVcs root = new FilePathUnderVcs(path, vcs);
takeDirt(new Consumer<DirtBuilder>() {
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequest.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequest.java
index 7eeb2d746072..55580f565f90 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequest.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequest.java
@@ -83,7 +83,6 @@ public class ChangeDiffRequest implements ChangeRequestChain {
}
}
- @Nullable
public void quickCheckHaveStuff() throws VcsException {
if (mySteps.isEmpty()) {
throw new VcsException("Nothing selected to show diff");
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequestPresentable.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequestPresentable.java
index 560d51916e29..9be4537e5ee8 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequestPresentable.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ChangeDiffRequestPresentable.java
@@ -80,7 +80,7 @@ public class ChangeDiffRequestPresentable implements DiffRequestPresentable {
return ChangesUtil.getFilePath(myChange).getPath();
}
- @Nullable
+ @Override
public void haveStuff() throws VcsException {
final List<String> errSb = new ArrayList<String>();
final boolean canShow = checkContentsAvailable(myChange.getBeforeRevision(), myChange.getAfterRevision(), errSb);
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java
index fc26b3b1eb02..cd4a1feeb267 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java
@@ -107,7 +107,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor {
TransparentlyFailedValueI<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo,
CommitContext commitContext, final Consumer<InfoGroup> worker) {
final PatchEP[] extensions = Extensions.getExtensions(PatchEP.EP_NAME, project);
- if (extensions == null && extensions.length == 0) return;
+ if (extensions.length == 0) return;
if (additionalInfo != null) {
try {
final Map<String, Map<String, CharSequence>> map = additionalInfo.get();
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 367942f4ca75..6159d39f7c82 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
@@ -660,6 +660,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
final DefaultListCleaner defaultListCleaner = new DefaultListCleaner();
runBeforeCommitHandlers(new Runnable() {
public void run() {
+ boolean success = false;
try {
final boolean completed = ProgressManager.getInstance().runProcessWithProgressSynchronously(
new Runnable() {
@@ -673,6 +674,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
handler.checkinSuccessful();
}
+ success = true;
defaultListCleaner.clean();
close(OK_EXIT_CODE);
}
@@ -688,6 +690,16 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
handler.checkinFailed(Arrays.asList(new VcsException(e)));
}
}
+ finally {
+ if (myResultHandler != null) {
+ if (success) {
+ myResultHandler.onSuccess(getCommitMessage());
+ }
+ else {
+ myResultHandler.onFailure();
+ }
+ }
+ }
}
}, commitExecutor);
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/SelectFilesDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/SelectFilesDialog.java
index 750b816f339f..2bff64ce8487 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/SelectFilesDialog.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/SelectFilesDialog.java
@@ -42,13 +42,23 @@ public class SelectFilesDialog extends AbstractSelectFilesDialog<VirtualFile> {
@NotNull private final VirtualFileList myFileList;
private final boolean myDeletableFiles;
- public SelectFilesDialog(Project project, List<VirtualFile> originalFiles, String prompt, VcsShowConfirmationOption confirmationOption,
- boolean selectableFiles, boolean showDoNotAskOption, boolean deletableFiles) {
+ protected SelectFilesDialog(Project project, List<VirtualFile> originalFiles, String prompt,
+ VcsShowConfirmationOption confirmationOption,
+ boolean selectableFiles, boolean showDoNotAskOption, boolean deletableFiles) {
super(project, false, confirmationOption, prompt, showDoNotAskOption);
myDeletableFiles = deletableFiles;
myFileList = new VirtualFileList(project, originalFiles, selectableFiles, deletableFiles);
myFileList.setChangesToDisplay(originalFiles);
- init();
+ }
+
+ @NotNull
+ public static SelectFilesDialog init(Project project, List<VirtualFile> originalFiles, String prompt,
+ VcsShowConfirmationOption confirmationOption,
+ boolean selectableFiles, boolean showDoNotAskOption, boolean deletableFiles) {
+ SelectFilesDialog dialog = new SelectFilesDialog(project, originalFiles, prompt, confirmationOption, selectableFiles,
+ showDoNotAskOption, deletableFiles);
+ dialog.init();
+ return dialog;
}
public Collection<VirtualFile> getSelectedFiles() {
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java
index be10b7faa5fd..1ad3f1dba517 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/AbstractVcsHelperImpl.java
@@ -150,7 +150,7 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
return null;
}
- SelectFilesDialog dlg = new SelectFilesDialog(myProject, files, prompt, confirmationOption, true, true, false);
+ SelectFilesDialog dlg = SelectFilesDialog.init(myProject, files, prompt, confirmationOption, true, true, false);
dlg.setTitle(title);
if (! confirmationOption.isPersistent()) {
dlg.setDoNotAskOption(null);
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
index cb5d8fa59223..71d181f10b72 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/NewMappings.java
@@ -83,7 +83,9 @@ public class NewMappings {
vcsManager.addInitializationRequest(VcsInitObject.MAPPINGS, new DumbAwareRunnable() {
public void run() {
- activateActiveVcses();
+ if (!myProject.isDisposed()) {
+ activateActiveVcses();
+ }
}
});
}
@@ -182,9 +184,15 @@ public class NewMappings {
}
public void mappingsChanged() {
- myMessageBus.syncPublisher(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED).directoryMappingChanged();
- myFileStatusManager.fileStatusesChanged();
- myFileWatchRequestsManager.ping();
+ ApplicationManager.getApplication().runReadAction(new Runnable() {
+ @Override
+ public void run() {
+ if (myProject.isDisposed()) return;
+ myMessageBus.syncPublisher(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED).directoryMappingChanged();
+ myFileStatusManager.fileStatusesChanged();
+ myFileWatchRequestsManager.ping();
+ }
+ });
}
@Modification
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java
index d24ddab1ccd8..0a2f8f9416b9 100644
--- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java
+++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java
@@ -297,9 +297,9 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
myNext = treeNode.getFilePointer();
myStatus = FileStatus.MODIFIED;
- final TreeNode parent = treeNode.getParent();
- if (parent instanceof GroupTreeNode) {
- final String id = ((GroupTreeNode)parent).getFileGroupId();
+ final GroupTreeNode parent = findParentGroupTreeNode(treeNode.getParent());
+ if (parent != null) {
+ final String id = parent.getFileGroupId();
if (FileGroup.CREATED_ID.equals(id)) {
myStatus = FileStatus.ADDED;
} else if (FileGroup.REMOVED_FROM_REPOSITORY_ID.equals(id)) {
@@ -311,6 +311,15 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
}
}
+ @Nullable
+ private GroupTreeNode findParentGroupTreeNode(@NotNull TreeNode treeNode) {
+ TreeNode currentNode = treeNode;
+ while (currentNode != null && !(currentNode instanceof GroupTreeNode)) {
+ currentNode = currentNode.getParent();
+ }
+ return (GroupTreeNode)currentNode;
+ }
+
public void remove() {
throw new UnsupportedOperationException();
}