public static @Nullable ListSelection<? extends ChangeDiffRequestChain.Producer> createDiffProducers(@NotNull DataContext dc,
                                                                                                       boolean withLocal) {
    final Project project = CommonDataKeys.PROJECT.getData(dc);
    if (project == null) return null;

    if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) return null;

    final String base = project.getBasePath();
    if (base == null) {
      LOG.error("No base path for project " + project);
      return null;
    }

    ListSelection<ShelvedWrapper> wrappers = ShelvedChangesViewManager.getSelectedChangesOrAll(dc);

    ApplyPatchContext patchContext = new ApplyPatchContext(project.getBaseDir(), 0, false, false);

    return wrappers.map(s -> {
      return createDiffProducer(project, base, patchContext, s, withLocal);
    });
  }
public static @Nullable ListSelection<? extends ChangeDiffRequestChain.Producer> createDiffProducers(@NotNull DataContext dc,
                                                                                                       boolean withLocal)