From e5df9eed91498ad7e07cc7dba815dac34c223b04 Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 19 Jun 2012 14:08:10 +0400 Subject: [PATCH] git update: correct order of progress changes (with continuation) --- .../src/git4idea/stash/GitShelveChangesSaver.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java b/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java index 6994f3777f90..467bf02936c8 100644 --- a/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java +++ b/plugins/git4idea/src/git4idea/stash/GitShelveChangesSaver.java @@ -26,6 +26,8 @@ import com.intellij.openapi.vcs.changes.shelf.ShelvedChangesViewManager; import com.intellij.openapi.vcs.impl.LocalChangesUnderRoots; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.continuation.ContinuationContext; +import com.intellij.util.continuation.TaskDescriptor; +import com.intellij.util.continuation.Where; import git4idea.commands.Git; import git4idea.i18n.GitBundle; import git4idea.rollback.GitRollbackEnvironment; @@ -85,14 +87,17 @@ public class GitShelveChangesSaver extends GitChangesSaver { protected void load(ContinuationContext context) { if (myShelvedLists != null) { LOG.info("load "); - String oldProgressTitle = myProgressIndicator.getText(); + final String oldProgressTitle = myProgressIndicator.getText(); myProgressIndicator.setText(GitBundle.getString("update.unshelving.changes")); - if (myShelvedLists != null) { - for (ShelvedChangeList list : myShelvedLists.values()) { - GitShelveUtils.doSystemUnshelve(myProject, list, myShelveManager, context); + context.next(new TaskDescriptor("", Where.AWT) { + @Override + public void run(ContinuationContext context) { + myProgressIndicator.setText(oldProgressTitle); } + }); + for (ShelvedChangeList list : myShelvedLists.values()) { + GitShelveUtils.doSystemUnshelve(myProject, list, myShelveManager, context); } - myProgressIndicator.setText(oldProgressTitle); } }