Search in sources :

Example 1 with ShelveChangesManager

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);
    }
}
Also used : ShelveChangesManager(com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager) VcsException(com.intellij.openapi.vcs.VcsException) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) List(java.util.List) IOException(java.io.IOException) Map(java.util.Map)

Aggregations

VcsException (com.intellij.openapi.vcs.VcsException)1 LocalChangeList (com.intellij.openapi.vcs.changes.LocalChangeList)1 ShelveChangesManager (com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager)1 IOException (java.io.IOException)1 List (java.util.List)1 Map (java.util.Map)1 SvnChangeList (org.jetbrains.idea.svn.history.SvnChangeList)1