IDEA-53894 (IDEA is unable to show diff for shelved new files)
authorirengrig <Irina.Chernushina@jetbrains.com>
Wed, 14 Apr 2010 08:43:14 +0000 (12:43 +0400)
committerirengrig <Irina.Chernushina@jetbrains.com>
Wed, 14 Apr 2010 08:43:14 +0000 (12:43 +0400)
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/DiffShelvedChangesAction.java

index cfbb0c06b09da212d788eef486b7eb240fcd74ae..a5ec39969922252ac489641ce5d71bbf28d28490 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.MessageType;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vcs.FilePath;
+import com.intellij.openapi.vcs.FileStatus;
 import com.intellij.openapi.vcs.VcsException;
 import com.intellij.openapi.vcs.changes.Change;
 import com.intellij.openapi.vcs.changes.ContentRevision;
@@ -78,7 +79,7 @@ public class DiffShelvedChangesAction extends AnAction implements DumbAware {
       final Change change = shelvedChange.getChange(project);
       final String beforePath = shelvedChange.getBeforePath();
       try {
-        final VirtualFile f = ApplyTextFilePatch.findPatchTarget(context, beforePath, shelvedChange.getAfterPath(), beforePath == null);
+        final VirtualFile f = ApplyTextFilePatch.findPatchTarget(context, beforePath, shelvedChange.getAfterPath(), FileStatus.ADDED.equals(shelvedChange.getFileStatus()));
         if ((f == null) || (! f.exists())) {
           if (beforePath != null) {
             missing.add(beforePath);