void (final @NotNull Project project, final @NotNull List<ShelvedChangeList> selectedChangeLists, final @NotNull List<ShelvedChange> selectedChanges, final @NotNull List<ShelvedBinaryFile> selectedBinaryChanges, final @Nullable LocalChangeList forcePredefinedOneChangelist, boolean removeFilesFromShelf) { ProgressManager.getInstance().run(new Task.Backgroundable(project, VcsBundle.message("unshelve.changes.progress.title"), true) { @Override public void run(@NotNull ProgressIndicator indicator) { for (ShelvedChangeList changeList : selectedChangeLists) { List<ShelvedChange> changesForChangelist = new ArrayList<>(ContainerUtil.intersection(Objects.requireNonNull(changeList.getChanges()), selectedChanges)); List<ShelvedBinaryFile> binariesForChangelist = new ArrayList<>(ContainerUtil.intersection(changeList.getBinaryFiles(), selectedBinaryChanges)); boolean shouldUnshelveAllList = changesForChangelist.isEmpty() && binariesForChangelist.isEmpty(); ApplyPatchStatus status = unshelveChangeList( changeList, shouldUnshelveAllList ? null : changesForChangelist, shouldUnshelveAllList ? null : binariesForChangelist, forcePredefinedOneChangelist != null ? forcePredefinedOneChangelist : getChangeListUnshelveTo(changeList), true, removeFilesFromShelf); ChangeListManagerEx.getInstanceEx(myProject).waitForUpdate(); if (status == ApplyPatchStatus.ABORT) { break; } } } }); }