summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRobin Stocker2011-08-09 17:12:34 (EDT)
committer Matthias Sohn2011-08-09 17:12:34 (EDT)
commit5aeae305c2d4e54131af3c427d66b2d4fc356743 (patch)
tree400e767baeefe4ccc24a86c66aa857930900b1b5
parentceb3a55be05461db0d5f35818066ff5a3b305d6f (diff)
downloadegit-5aeae305c2d4e54131af3c427d66b2d4fc356743.zip
egit-5aeae305c2d4e54131af3c427d66b2d4fc356743.tar.gz
egit-5aeae305c2d4e54131af3c427d66b2d4fc356743.tar.bz2
MultiPullResultDialog: Fix overall status columnrefs/changes/50/3950/2
It would always say "OK" even when the rebase or merge failed. It now displays "Failed" when the status is not successful. Also, the logic for rebase was inverted, leading to the image indicating failure when the rebase was successful. Depends on JGit change Icfc9a9c76763f8a777087a1262c8d6ad251a9068 for isSuccessful. Change-Id: Id3bb809c83464c20b20a93aeae048f9a2edbea63 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java35
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties1
3 files changed, 11 insertions, 28 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
index 13399ac..6596541 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
@@ -2938,6 +2938,9 @@ public class UIText extends NLS {
public static String MultiPullResultDialog_OkStatus;
/** */
+ public static String MultiPullResultDialog_FailedStatus;
+
+ /** */
public static String MultiPullResultDialog_OverallStatusColumnHeader;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java
index 69c7fb2..658a0e3 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/pull/MultiPullResultDialog.java
@@ -31,7 +31,6 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jgit.api.MergeResult;
import org.eclipse.jgit.api.PullResult;
import org.eclipse.jgit.api.RebaseResult;
import org.eclipse.jgit.lib.Repository;
@@ -74,7 +73,6 @@ public class MultiPullResultDialog extends Dialog {
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex != 3)
return null;
- boolean error = false;
Entry<Repository, Object> item = (Entry<Repository, Object>) element;
Object resultOrError = item.getValue();
if (resultOrError instanceof IStatus)
@@ -82,31 +80,8 @@ public class MultiPullResultDialog extends Dialog {
ISharedImages.IMG_ELCL_STOP);
PullResult res = (PullResult) item.getValue();
- MergeResult mres = res.getMergeResult();
- if (mres != null) {
- switch (mres.getMergeStatus()) {
- case ALREADY_UP_TO_DATE:
- case FAST_FORWARD:
- case MERGED:
- break;
- default:
- error = true;
- break;
- }
- }
- RebaseResult rres = res.getRebaseResult();
- if (rres != null) {
- switch (rres.getStatus()) {
- case ABORTED:
- case FAILED:
- case STOPPED:
- break;
- default:
- error = true;
- break;
- }
- }
- if (error)
+ boolean success = res.isSuccessful();
+ if (!success)
return PlatformUI.getWorkbench().getSharedImages().getImage(
ISharedImages.IMG_ELCL_STOP);
return null;
@@ -157,7 +132,11 @@ public class MultiPullResultDialog extends Dialog {
IStatus status = (IStatus) item.getValue();
return status.getMessage();
}
- return UIText.MultiPullResultDialog_OkStatus;
+ PullResult res = (PullResult) item.getValue();
+ if (res.isSuccessful())
+ return UIText.MultiPullResultDialog_OkStatus;
+ else
+ return UIText.MultiPullResultDialog_FailedStatus;
default:
return null;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
index e095343..4ddf958 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
@@ -1089,6 +1089,7 @@ MultiPullResultDialog_MergeResultMessage=Merge result: {0}
MultiPullResultDialog_NothingFetchedStatus=Nothing fetched
MultiPullResultDialog_NothingUpdatedStatus=Nothing updated
MultiPullResultDialog_OkStatus=OK
+MultiPullResultDialog_FailedStatus=Failed
MultiPullResultDialog_OverallStatusColumnHeader=Overall Status
MultiPullResultDialog_RebaseResultMessage=Rebase result: {0}
MultiPullResultDialog_RepositoryColumnHeader=Repository