public void save(@NotNull Collection<? extends VirtualFile> rootsToSave) throws VcsException {
    LOG.info("save " + rootsToSave);

    String oldProgressTitle = myProgressIndicator.getText();
    myProgressIndicator.setText(VcsBundle.message("vcs.shelving.changes"));

    ChangeListManager changeListManager = ChangeListManager.getInstance(project);
    Collection<Change> allChanges = changeListManager.getAllChanges();

    if (ContainerUtil.exists(allChanges, change -> change.getBeforeRevision() instanceof FakeRevision ||
                                                   change.getAfterRevision() instanceof FakeRevision)) {
      LOG.error("Local changes are not up-to-date yet. Changes saving may not be accurate.", new Throwable());
    }

    Set<VirtualFile> rootsSet = new HashSet<>(rootsToSave);
    if (changeListManager.areChangeListsEnabled()) {
      for (LocalChangeList list : changeListManager.getChangeLists()) {
        Collection<Change> changes = filterChangesByRoots(list.getChanges(), rootsSet);
        if (!changes.isEmpty()) {
          String name = createSystemShelvedChangeListName(myStashMessage, list.getName());
          ShelvedChangeList shelved = VcsShelveUtils.shelveChanges(project, changes, name, false, true);
          myShelvedLists.put(list.getId(), shelved);
        }
      }
    }
    else {
      Collection<Change> changes = filterChangesByRoots(allChanges, rootsSet);
      if (!changes.isEmpty()) {
        ShelvedChangeList shelved = VcsShelveUtils.shelveChanges(project, changes, myStashMessage, false, true);
        myShelvedLists.put(null, shelved);
      }
    }

    doRollback(rootsToSave, allChanges);

    myProgressIndicator.setText(oldProgressTitle);
  }
public void save(@NotNull Collection<? extends VirtualFile> rootsToSave)