Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-02-02 09:47:08 +0000
committerMatthias Sohn2015-02-03 00:35:51 +0000
commita20799bb52d18f54820015685841eff18be26fba (patch)
treee78155b83a5349f662a8a0c7b4a33c0a7c42ebea
parent339818858fd7c31a49c1bf6089c8445c4933b15b (diff)
downloadegit-a20799bb52d18f54820015685841eff18be26fba.tar.gz
egit-a20799bb52d18f54820015685841eff18be26fba.tar.xz
egit-a20799bb52d18f54820015685841eff18be26fba.zip
Lookup active window before opening commit selection dialog
Just seen that "Compare with Previous" will fail on Eclipse 3.8 due to some bugs in HandlerUtil, if executed on a file which last version is a merge version. In this case we open a selection dialog (for selecting the merge commit's predecessor version to compare against), and this makes the "active window" variable disappear. The simple fix is to read the variable before we open a dialog. Change-Id: I8b9cbcda45cc01aa2e8ccd65527638bb51b6e52d Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
index 5e38ceb995..d2fba4def8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithPreviousActionHandler.java
@@ -65,12 +65,12 @@ public class CompareWithPreviousActionHandler extends RepositoryActionHandler {
return Status.CANCEL_STATUS;
}
try {
+ IWorkbenchPage workBenchPage = HandlerUtil
+ .getActiveWorkbenchWindowChecked(event)
+ .getActivePage();
final PreviousCommit previous = getPreviousRevision(event,
resources[0]);
if (previous != null) {
- IWorkbenchPage workBenchPage = HandlerUtil
- .getActiveWorkbenchWindowChecked(event)
- .getActivePage();
CompareUtils.compare(resources, repository,
Constants.HEAD, previous.commit.getName(),
true, workBenchPage);

Back to the top