Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-08-26 07:01:35 +0000
committerThomas Wolf2016-08-26 07:01:35 +0000
commit7069243c32afd4af29cf5218976bf03f85e562cd (patch)
treebacb85defe7cee590c7ee0911d870a1a6fc8e19b
parentbc712de04c05c0e7746ace56a37e51acbaa64cfd (diff)
downloadegit-7069243c32afd4af29cf5218976bf03f85e562cd.tar.gz
egit-7069243c32afd4af29cf5218976bf03f85e562cd.tar.xz
egit-7069243c32afd4af29cf5218976bf03f85e562cd.zip
Push to Gerrit in a background job
Bug: 497161 Change-Id: Ib6f18290f0b5b1aedda147dba75e35a650272f26 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
index 1976451c3d..02638cb6f9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
@@ -13,7 +13,6 @@
package org.eclipse.egit.ui.internal.push;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -26,16 +25,12 @@ import java.util.TreeSet;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.internal.gerrit.GerritUtil;
-import org.eclipse.egit.core.op.PushOperationResult;
import org.eclipse.egit.core.op.PushOperationSpecification;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIUtils;
import org.eclipse.egit.ui.internal.CommonUtils;
import org.eclipse.egit.ui.internal.UIText;
-import org.eclipse.egit.ui.internal.credentials.EGitCredentialsProvider;
import org.eclipse.egit.ui.internal.gerrit.GerritDialogSettings;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.Dialog;
@@ -46,7 +41,6 @@ import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jgit.lib.BranchConfig;
import org.eclipse.jgit.lib.ConfigConstants;
@@ -477,34 +471,13 @@ public class PushToGerritPage extends WizardPage {
spec.addURIRefUpdates(uri, Arrays.asList(update));
final PushOperationUI op = new PushOperationUI(repository, spec,
false);
- op.setCredentialsProvider(new EGitCredentialsProvider());
- final PushOperationResult[] result = new PushOperationResult[1];
- getContainer().run(true, true, new IRunnableWithProgress() {
- @Override
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- try {
- result[0] = op.execute(monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- });
- PushResultDialog.show(repository, result[0],
- op.getDestinationString(), false, false);
storeLastUsedUri(uriCombo.getText());
storeLastUsedBranch(branchText.getText());
storeLastUsedTopic(topicText.isEnabled(),
topicText.getText().trim(), repository.getBranch());
- } catch (URISyntaxException e) {
- Activator.handleError(e.getMessage(), e, true);
- } catch (IOException e) {
+ op.start();
+ } catch (URISyntaxException | IOException e) {
Activator.handleError(e.getMessage(), e, true);
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- Activator.handleError(cause.getMessage(), cause, true);
- } catch (InterruptedException e) {
- // cancellation
}
}

Back to the top