Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hohenegger2019-12-30 13:41:22 +0000
committerMax Hohenegger2019-12-30 13:42:59 +0000
commit540c1fff36c96665b8cfbbfde6bb8a58d5533866 (patch)
tree691c930af7e0f8cd2d31f8290540f15116fa097d
parent74735166e9886f51705e7ca13abfb96eccc039b5 (diff)
downloadegit-540c1fff36c96665b8cfbbfde6bb8a58d5533866.tar.gz
egit-540c1fff36c96665b8cfbbfde6bb8a58d5533866.tar.xz
egit-540c1fff36c96665b8cfbbfde6bb8a58d5533866.zip
Fix: Gitflow Publish is silent on failure.
Use regular EGit ShowPushResultAction to show error (and success) messages. Bug 493952 Change-Id: Ic733b58879d371966c287bbfc9c2a1dce2f18d7b
-rw-r--r--org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java7
-rw-r--r--org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/PostPublishUiTask.java47
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java3
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties1
-rw-r--r--org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java7
-rw-r--r--org.eclipse.egit.ui/META-INF/MANIFEST.MF2
7 files changed, 53 insertions, 15 deletions
diff --git a/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF
index e773c079f1..154b5aa88b 100644
--- a/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF
@@ -24,6 +24,7 @@ Import-Package: org.eclipse.egit.core;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.components;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.decorators;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.expressions;version="[5.7.0,5.8.0)",
+ org.eclipse.egit.ui.internal.push;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.rebase;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.repository.tree;version="[5.7.0,5.8.0)",
org.eclipse.egit.ui.internal.selection;version="[5.7.0,5.8.0)",
diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java
index 46fe2bd128..0cd6f99f4c 100644
--- a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java
+++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java
@@ -35,10 +35,11 @@ public abstract class AbstractPublishHandler extends AbstractHandler {
try {
int timeout = Activator.getDefault().getPreferenceStore()
.getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
- CurrentBranchPublishOperation featurePublishOperation = new CurrentBranchPublishOperation(
+ CurrentBranchPublishOperation publishOperation = new CurrentBranchPublishOperation(
gfRepo, timeout);
- JobUtil.scheduleUserWorkspaceJob(featurePublishOperation,
- getProgressText(), JobFamilies.REBASE);
+ JobUtil.scheduleUserWorkspaceJob(publishOperation,
+ getProgressText(), JobFamilies.REBASE,
+ new PostPublishUiTask(gfRepo, publishOperation));
} catch (CoreException e) {
return error(e.getMessage(), e);
}
diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/PostPublishUiTask.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/PostPublishUiTask.java
new file mode 100644
index 0000000000..ff1f2f7c7f
--- /dev/null
+++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/PostPublishUiTask.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2019, Max Hohenegger <eclipse@hohenegger.eu>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.gitflow.ui.internal.actions;
+
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.egit.gitflow.GitFlowRepository;
+import org.eclipse.egit.gitflow.op.CurrentBranchPublishOperation;
+import org.eclipse.egit.ui.internal.push.PushMode;
+import org.eclipse.egit.ui.internal.push.ShowPushResultAction;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.ui.PlatformUI;
+
+class PostPublishUiTask extends JobChangeAdapter {
+
+ private final GitFlowRepository gfRepo;
+
+ private final CurrentBranchPublishOperation operation;
+
+ PostPublishUiTask(GitFlowRepository gfRepo,
+ CurrentBranchPublishOperation operation) {
+ this.gfRepo = gfRepo;
+ this.operation = operation;
+ }
+
+ @Override
+ public void done(IJobChangeEvent jobChangeEvent) {
+ Action resultAction = new ShowPushResultAction(
+ gfRepo.getRepository(),
+ operation.getOperationResult(),
+ Constants.DEFAULT_REMOTE_NAME,
+ false,
+ PushMode.UPSTREAM);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {
+ resultAction.run();
+ });
+ }
+}
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
index 2b8928efe4..4d07ab9567 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/CoreText.java
@@ -46,9 +46,6 @@ public class CoreText extends NLS {
public static String FeatureListOperation_unableToParse;
/** */
- public static String pushToRemoteFailed;
-
- /** */
public static String unableToStoreGitConfig;
/** */
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
index 4b0c24ca49..2341c4d927 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties
@@ -13,7 +13,6 @@ AbstractHotfixOperation_notOnAHotfixBranch=Not on a hotfix branch.
AbstractReleaseOperation_notOnAReleaseBranch=Not on a release branch.
AbstractVersionFinishOperation_tagNameExists=Tag with name ''{0}'' already exists\!
FeatureListOperation_unableToParse=Unable to parse: {0}
-pushToRemoteFailed=Push to remote repository failed: {0}
unableToStoreGitConfig=Unable to store git config.
FeatureStartOperation_andBranchMayBeFastForwarded=And branch ''{0}'' may be fast-forwarded.
FeatureStartOperation_andLocalDevelopIsAheadOfOrigin=And local branch ''{0}'' is ahead of ''{1}''.
diff --git a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java
index 6d44d1a8bb..5d3a84f28a 100644
--- a/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java
+++ b/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java
@@ -23,7 +23,6 @@ import org.eclipse.egit.core.op.PushOperation;
import org.eclipse.egit.core.op.PushOperationResult;
import org.eclipse.egit.gitflow.GitFlowRepository;
import org.eclipse.egit.gitflow.internal.CoreText;
-import org.eclipse.osgi.util.NLS;
/**
* git flow * publish
@@ -55,12 +54,6 @@ public class CurrentBranchPublishOperation extends GitFlowOperation {
timeout);
pushOperation.run(monitor);
operationResult = pushOperation.getOperationResult();
-
- if (!operationResult.isSuccessfulConnectionForAnyURI()) {
- String errorMessage = NLS.bind(CoreText.pushToRemoteFailed,
- operationResult.getErrorStringForAllURis());
- throw new CoreException(error(errorMessage));
- }
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
throw new CoreException(error(targetException.getMessage(),
diff --git a/org.eclipse.egit.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
index 5fd781f2d4..658b7a4ef8 100644
--- a/org.eclipse.egit.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui/META-INF/MANIFEST.MF
@@ -104,7 +104,7 @@ Export-Package: org.eclipse.egit.ui;version="5.7.0";x-friends:="org.eclipse.egit
org.eclipse.egit.ui.internal.preferences;version="5.7.0";x-internal:=true,
org.eclipse.egit.ui.internal.provisional.wizards;version="5.7.0";x-internal:=true,
org.eclipse.egit.ui.internal.pull;version="5.7.0";x-internal:=true,
- org.eclipse.egit.ui.internal.push;version="5.7.0";x-internal:=true,
+ org.eclipse.egit.ui.internal.push;version="5.7.0";x-friends:="org.eclipse.egit.gitflow.ui",
org.eclipse.egit.ui.internal.rebase;version="5.7.0";x-friends:="org.eclipse.egit.gitflow.ui",
org.eclipse.egit.ui.internal.reflog;version="5.7.0";x-internal:=true,
org.eclipse.egit.ui.internal.reflog.command;version="5.7.0";x-internal:=true,

Back to the top