From f555182441045f655dcd3d67f0505c90e4d8c2fe Mon Sep 17 00:00:00 2001 From: Irina Chernushina Date: Tue, 7 Oct 2008 14:39:40 +0400 Subject: [PATCH] SVN: load default branches configuration under progress if needed --- .../idea/svn/SvnBranchConfigurationManager.java | 30 +++++++++++++++++++--- .../org/jetbrains/idea/svn/SvnBundle.properties | 4 ++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBranchConfigurationManager.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBranchConfigurationManager.java index db4739374a..84466f92ab 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBranchConfigurationManager.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBranchConfigurationManager.java @@ -22,8 +22,10 @@ import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.progress.ProcessCanceledException; +import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.Ref; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.committed.VcsConfigurationChangeListener; import com.intellij.openapi.vfs.VirtualFile; @@ -126,12 +128,32 @@ public class SvnBranchConfigurationManager implements PersistentStateComponent exceptionRef = new Ref(); + ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() { + public void run() { + try { + ProgressManager.getInstance().getProgressIndicator().setText( + SvnBundle.message("loading.data.for.root.text", vcsRoot.getPresentableUrl())); + final SvnBranchConfiguration loadedConfiguration = load(vcsRoot); + setConfiguration(vcsRoot, loadedConfiguration, false); + } + catch (VcsException e) { + exceptionRef.set(e); + } + } + }, SvnBundle.message("loading.default.branches.configuration.text"), false, myProject); + if (! exceptionRef.isNull()) { + throw exceptionRef.get(); + } + configuration = myConfigurationBean.myConfigurationMap.get(vcsRoot.getPath()); + } else { + configuration = load(vcsRoot); + setConfiguration(vcsRoot, configuration, false); + } } return configuration; } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties index 12de17d502..7e021a4512 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnBundle.properties @@ -570,4 +570,6 @@ undo.integrate.to.branch=Undo Integrate To Branch... undo.integrate.to.branch.description=Removes changes done in revision from branch undo.integrate.to.branch.dialog.title=Undo Integrate To Branch merge.source.details.title=Merge source details for {0} [{1}] -repository.browser.edit.location.dialog.title= Edit Location Url \ No newline at end of file +repository.browser.edit.location.dialog.title= Edit Location Url +loading.default.branches.configuration.text=Loading default branches configuration... +loading.data.for.root.text=Loading data for {0} \ No newline at end of file -- 2.11.4.GIT