use of com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager in project intellij-community by JetBrains.
the class LocalChangesPromptTask method shelveChanges.
private void shelveChanges(@NotNull Intersection intersection) throws VcsException {
try {
getApplication().invokeAndWait(() -> FileDocumentManager.getInstance().saveAllDocuments());
ShelveChangesManager shelveManager = ShelveChangesManager.getInstance(myMergeContext.getProject());
for (Map.Entry<String, List<Change>> entry : intersection.getChangesByLists().entrySet()) {
String shelfName = intersection.getComment(entry.getKey()) + " (auto shelve before merge)";
shelveManager.shelveChanges(entry.getValue(), shelfName, true, true);
}
} catch (IOException e) {
throw new VcsException(e);
}
}
Aggregations