vcs annotate: cleanup
authorAleksey Pivovarov <AMPivovarov@gmail.com>
Sat, 20 Jun 2015 12:42:54 +0000 (15:42 +0300)
committerAleksey Pivovarov <AMPivovarov@gmail.com>
Thu, 3 Sep 2015 16:28:03 +0000 (19:28 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java

index dbacfe468507189958484ebbbc79c406851163cc..50768a3f14a13dee21dcfde6108702646b52df6c 100644 (file)
@@ -215,11 +215,11 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
     ProgressManager.getInstance().run(annotateTask);
   }
 
     ProgressManager.getInstance().run(annotateTask);
   }
 
-  public static void doAnnotate(final Editor editor,
-                                final Project project,
-                                final VirtualFile file,
-                                final FileAnnotation fileAnnotation,
-                                final AbstractVcs vcs,
+  public static void doAnnotate(@NotNull final Editor editor,
+                                @NotNull final Project project,
+                                @NotNull final VirtualFile currentFile,
+                                @NotNull final FileAnnotation fileAnnotation,
+                                @NotNull final AbstractVcs vcs,
                                 final boolean onCurrentRevision) {
     editor.getGutter().closeAllAnnotations();
 
                                 final boolean onCurrentRevision) {
     editor.getGutter().closeAllAnnotations();
 
@@ -237,7 +237,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
       }
     });
     if (onCurrentRevision) {
       }
     });
     if (onCurrentRevision) {
-      ProjectLevelVcsManager.getInstance(project).getAnnotationLocalChangesListener().registerAnnotation(file, fileAnnotation);
+      ProjectLevelVcsManager.getInstance(project).getAnnotationLocalChangesListener().registerAnnotation(fileAnnotation.getFile(), fileAnnotation);
     }
 
     final EditorGutterComponentEx editorGutter = (EditorGutterComponentEx)editor.getGutter();
     }
 
     final EditorGutterComponentEx editorGutter = (EditorGutterComponentEx)editor.getGutter();
@@ -247,7 +247,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
 
     final AnnotationPresentation presentation = new AnnotationPresentation(fileAnnotation, getUpToDateLineNumber, switcher);
     if (vcs.getCommittedChangesProvider() != null) {
 
     final AnnotationPresentation presentation = new AnnotationPresentation(fileAnnotation, getUpToDateLineNumber, switcher);
     if (vcs.getCommittedChangesProvider() != null) {
-      presentation.addAction(new ShowDiffFromAnnotation(fileAnnotation, vcs, file));
+      presentation.addAction(new ShowDiffFromAnnotation(fileAnnotation, vcs, currentFile));
     }
     presentation.addAction(new CopyRevisionNumberFromAnnotateAction(fileAnnotation));
     presentation.addAction(Separator.getInstance());
     }
     presentation.addAction(new CopyRevisionNumberFromAnnotateAction(fileAnnotation));
     presentation.addAction(Separator.getInstance());