IDEA-79785 Perforce: do not mark file as modified when trying to Get Revision in...
authorpeter <peter@jetbrains.com>
Wed, 25 Jan 2012 14:53:33 +0000 (15:53 +0100)
committerpeter <peter@jetbrains.com>
Wed, 25 Jan 2012 14:58:59 +0000 (15:58 +0100)
platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java

index f6b02c6a7ed5530112bfc982ccc7490cf0ba71e4..1f9bba3fa3b10061f7b3fb6d31b89e0eddf5bd74 100644 (file)
@@ -992,11 +992,6 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
     private void getVersion(final VcsFileRevision revision) {
       final VirtualFile file = getVirtualFile();
       final Project project = myVcs.getProject();
-      if ((file != null) && !file.isWritable()) {
-        if (ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(file).hasReadonlyFiles()) {
-          return;
-        }
-      }
 
       new Task.Backgroundable(project, VcsBundle.message("show.diff.progress.title")) {
         @Override
@@ -1034,6 +1029,12 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
                   public void run() {
                     CommandProcessor.getInstance().executeCommand(project, new Runnable() {
                       public void run() {
+                        if (file != null && !file.isWritable()) {
+                          if (ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(file).hasReadonlyFiles()) {
+                            return;
+                          }
+                        }
+
                         try {
                           write(revisionContent);
                         } catch (IOException e) {