public static Pair<VcsRevisionNumber, byte[]> getOrLoadCurrentAsBytes(@NotNull Project project,
                                                                        @NotNull FilePath path,
                                                                        @NotNull VcsKey vcsKey,
                                                                        @NotNull CurrentRevisionProvider loader)
    throws VcsException, IOException {
    ContentRevisionCache cache = ProjectLevelVcsManager.getInstance(project).getContentRevisionCache();

    while (true) {
      VcsRevisionNumber currentRevision = loader.getCurrentRevision();

      final byte[] cachedCurrent = cache.getBytes(path, currentRevision, vcsKey, UniqueType.REPOSITORY_CONTENT);
      if (cachedCurrent != null) {
        return Pair.create(currentRevision, cachedCurrent);
      }

      checkLocalFileSize(path);
      Pair<VcsRevisionNumber, byte[]> loaded = loader.get();

      if (loaded.getFirst().equals(currentRevision)) {
        cache.put(path, currentRevision, vcsKey, UniqueType.REPOSITORY_CONTENT, loaded.getSecond());
        return loaded;
      }
    }
  }
public static Pair<VcsRevisionNumber, byte[]> getOrLoadCurrentAsBytes(@NotNull Project project,
                                                                        @NotNull FilePath path,
                                                                        @NotNull VcsKey vcsKey,
                                                                        @NotNull CurrentRevisionProvider loader)