Author: adietish
Date: 2011-08-16 06:31:53 -0400 (Tue, 16 Aug 2011)
New Revision: 33967
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java
Log:
[JBIDE-9511] dont push if commit was cancelled
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java 2011-08-16
09:41:07 UTC (rev 33966)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/commands/CommitAndPushHandler.java 2011-08-16
10:31:53 UTC (rev 33967)
@@ -20,19 +20,20 @@
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
- executeCommand(EGIT_COMMIT_COMMAND_ID, selection );
- executeCommand(EGIT_PUSH_COMMAND_ID, selection);
+ if (executeCommand(EGIT_COMMIT_COMMAND_ID, selection )) {
+ executeCommand(EGIT_PUSH_COMMAND_ID, selection);
+ }
return null;
}
- private static void executeCommand(String commandId, ISelection selection) throws
ExecutionException {
+ private static boolean executeCommand(String commandId, ISelection selection) throws
ExecutionException {
if (!(selection instanceof IStructuredSelection)) {
throw new ExecutionException(NLS.bind("Could not execute command
\"{0}\" since there's no valid selection",
commandId));
}
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
try {
- CommandUtils.executeCommand(commandId, structuredSelection);
+ return CommandUtils.executeCommand(commandId, structuredSelection);
} catch (NotDefinedException e) {
throw new ExecutionException(NLS.bind("Could not execute command
\"{0}\" since it is not defined",
commandId), e);