Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2016-04-02 23:17:02 +0000
committerMatthias Sohn2016-04-03 23:45:16 +0000
commit236f56cce34383388c3e3aa1fbc8c6c161ede465 (patch)
tree33c53384dd5aa6a7d1bec4060deb88a1b6fd2843 /org.eclipse.egit.ui.test
parentcefa50d70d345e6b0983348ff99edffc7da78ee7 (diff)
downloadegit-236f56cce34383388c3e3aa1fbc8c6c161ede465.tar.gz
egit-236f56cce34383388c3e3aa1fbc8c6c161ede465.tar.xz
egit-236f56cce34383388c3e3aa1fbc8c6c161ede465.zip
When running "Commit" action open staging view instead of commit dialog
Add a preference to allow switching back to the old behavior of the commit action to open the commit dialog. By default it now opens the staging view. After opening the staging view auto-select and set focus on unstaged files if there are any, otherwise set focus on the commit message. The commit dialog is still used by CleanupUncomittedChangesDialog. Bug: 490121 Change-Id: I604f31268f83ab11c3f3a869edf3c7121f0e6478 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitActionTest.java9
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitNonWSChangesTest.java10
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java7
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java4
5 files changed, 35 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitActionTest.java
index 9841403997..7ff323e2b7 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitActionTest.java
@@ -35,6 +35,7 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,6 +49,8 @@ public class CommitActionTest extends LocalRepositoryTestCase {
@Before
public void setup() throws Exception {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, false);
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
TestUtil.configureTestCommitterAsUser(repo);
@@ -59,6 +62,12 @@ public class CommitActionTest extends LocalRepositoryTestCase {
assertTrue(dotProject.delete());
}
+ @After
+ public void tearDown() {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, true);
+ }
+
@Test
public void testOpenCommitWithoutChanged() throws Exception {
NoFilesToCommitPopup popup = CommitDialogTester
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitNonWSChangesTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitNonWSChangesTest.java
index 8f79fda5ec..91e13cae07 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitNonWSChangesTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/CommitNonWSChangesTest.java
@@ -17,6 +17,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.internal.repository.RepositoriesView;
@@ -29,6 +30,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,6 +46,8 @@ public class CommitNonWSChangesTest extends LocalRepositoryTestCase {
@Before
public void setup() throws Exception {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, false);
repositoryFile = createProjectAndCommitToRepository();
Activator.getDefault().getRepositoryUtil()
.addConfiguredRepository(repositoryFile);
@@ -51,6 +55,12 @@ public class CommitNonWSChangesTest extends LocalRepositoryTestCase {
.getRepositoryCache().lookupRepository(repositoryFile);
}
+ @After
+ public void tearDown() {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, true);
+ }
+
@Test
public void testCommitDeletedProject() throws Exception {
IProject project = ResourcesPlugin.getWorkspace().getRoot()
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
index 89a9fbf4ca..b9cda2da93 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewRepoDeletionTest.java
@@ -32,6 +32,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.RepositoryCacheRule;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.test.ContextMenuHelper;
@@ -144,6 +145,9 @@ public class GitRepositoriesViewRepoDeletionTest extends
@Test
public void testRemoveRepositoryRemoveFromCachesBug483664()
throws Exception {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, false);
+
deleteAllProjects();
assertProjectExistence(PROJ1, false);
clearView();
@@ -264,6 +268,9 @@ public class GitRepositoriesViewRepoDeletionTest extends
configuredRepos.isEmpty());
assertEquals("Expected no cached repositories", "[]", results[0]);
assertEquals("Expected no IndexDiffCache entries", "[]", results[1]);
+
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, true);
}
@Test
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index d47ecb4bc5..7196648991 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -32,6 +32,7 @@ import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.test.ContextMenuHelper;
import org.eclipse.egit.ui.test.TestUtil;
@@ -190,6 +191,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
*/
@Test
public void testContextMenuRepository() throws Exception {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, false);
// We just check if the dialogs open, the actual commit and import projects
// is tested elsewhere
SWTBotTree tree = getOrOpenView().bot().tree();
@@ -202,6 +205,8 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
myUtil.getPluginLocalizedValue("RepoViewImportProjects.label"),
NLS.bind(UIText.GitCreateProjectViaWizardWizard_WizardTitle,
repositoryFile));
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, true);
}
/**
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
index b50a8a479e..83a1f60b0e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
@@ -83,11 +83,15 @@ public abstract class AbstractSynchronizeViewTest extends
@Before
public void setupViews() {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, false);
TestUtil.showExplorerView();
}
@After
public void closeSynchronizeView() {
+ Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.ALWAYS_USE_STAGING_VIEW, true);
TestUtil.hideView(ISynchronizeView.VIEW_ID);
}

Back to the top