From 36c94d8bbd4d88baa2a14e743ffb6e7b9aec9f31 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 19 May 2011 14:32:55 +0400 Subject: [PATCH 1/3] [Git] IDEA-69906 Don't pass non-conflicting files to the merge dialog. --- .../src/git4idea/actions/GitResolveConflictsAction.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java b/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java index 895624d9804c..34363cc9709c 100644 --- a/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java @@ -44,6 +44,9 @@ public class GitResolveConflictsAction extends GitAction { } }); for (Change change : ChangeListManager.getInstance(project).getAllChanges()) { + if (change.getFileStatus() != FileStatus.MERGED_WITH_CONFLICTS) { + continue; + } final ContentRevision before = change.getBeforeRevision(); final ContentRevision after = change.getAfterRevision(); if (before != null) { From 51fd1197f614467219fccd6476984e28c2d6085e Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Thu, 19 May 2011 17:12:48 +0400 Subject: [PATCH 2/3] Less yellow code. --- .../ide/actions/RelatedItemLineMarkerGotoAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java b/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java index b1e0e71d1b07..a701e8133062 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java @@ -74,7 +74,9 @@ public class RelatedItemLineMarkerGotoAdapter extends GotoRelatedProvider { continue; } } - ContainerUtil.addIfNotNull(element.getContainingFile(), addedFiles); + if (element != null) { + ContainerUtil.addIfNotNull(element.getContainingFile(), addedFiles); + } result.add(item); } } From 45e51b5ae034159d52b9344c314ca451d9c832b0 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 19 May 2011 15:41:17 +0200 Subject: [PATCH 3/3] assume all content added to the queue requires content loading --- .../openapi/project/FileContentQueue.java | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java b/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java index 6eac681acb32..c506347723cd 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java @@ -23,7 +23,6 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.vfs.InvalidVirtualFileAccessException; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -100,21 +99,19 @@ public class FileContentQueue { boolean counterUpdated = false; try { - if (contentLength < PersistentFS.MAX_INTELLISENSE_FILESIZE) { - synchronized (this) { - while (myTotalSize > SIZE_THRESHOLD) { - if (indicator != null) { - indicator.checkCanceled(); - } - wait(300); + synchronized (this) { + while (myTotalSize > SIZE_THRESHOLD) { + if (indicator != null) { + indicator.checkCanceled(); } - myTotalSize += contentLength; - counterUpdated = true; + wait(300); } - - content.getBytes(); // Reads the content bytes and caches them. + myTotalSize += contentLength; + counterUpdated = true; } + content.getBytes(); // Reads the content bytes and caches them. + return true; } catch (Throwable e) { @@ -191,14 +188,12 @@ public class FileContentQueue { } return null; } - if (result.getLength() < PersistentFS.MAX_INTELLISENSE_FILESIZE) { - synchronized (this) { - try { - myTotalSize -= result.getLength(); - } - finally { - notifyAll(); - } + synchronized (this) { + try { + myTotalSize -= result.getLength(); + } + finally { + notifyAll(); } }