diff options
author | Max Hohenegger | 2019-12-30 13:41:22 +0000 |
---|---|---|
committer | Max Hohenegger | 2019-12-30 13:42:59 +0000 |
commit | 540c1fff36c96665b8cfbbfde6bb8a58d5533866 (patch) | |
tree | 691c930af7e0f8cd2d31f8290540f15116fa097d /org.eclipse.egit.gitflow.ui/src/org | |
parent | 74735166e9886f51705e7ca13abfb96eccc039b5 (diff) | |
download | egit-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
Diffstat (limited to 'org.eclipse.egit.gitflow.ui/src/org')
2 files changed, 51 insertions, 3 deletions
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(); + }); + } +} |