@NotNull
  @CalledInAny
  public static ApplyPatchForBaseRevisionTexts create(@NotNull Project project,
                                                      @NotNull VirtualFile file,
                                                      @NotNull FilePath pathBeforeRename,
                                                      @NotNull TextFilePatch patch,
                                                      @Nullable CharSequence baseContents) {
    assert !patch.isNewFile();

    String localContent = getLocalFileContent(file);

    if (baseContents != null) {
      ApplyPatchForBaseRevisionTexts result = createFromStoredBase(localContent, patch, baseContents);
      if (result != null) return result;
    }

    String beforeVersionId = patch.getBeforeVersionId();
    if (beforeVersionId != null) {
      ApplyPatchForBaseRevisionTexts result =
        createFromBaseVersionProvider(project, localContent, patch, beforeVersionId, file, pathBeforeRename);
      if (result != null) return result;
    }

    return createFromLocal(localContent, patch);
  }
@NotNull
  @CalledInAny
  public static ApplyPatchForBaseRevisionTexts create(@NotNull Project project,
                                                      @NotNull VirtualFile file,
                                                      @NotNull FilePath pathBeforeRename,
                                                      @NotNull TextFilePatch patch,
                                                      @Nullable CharSequence baseContents)