DESCRIPTION

[RFC] Open/close projects when switching branches

Store which projects are imported on each branch and
add/open projects when a checkout is done

Close projects that don't exist on branches being checked
out and reopen them when the previous branch is checked out.

There is a new preferences on the 'Projects' page for
this behavior and it is enabled by default

Bug: 350866
Change-Id: I4d33f4120bce03941c1610b22870adfa529b1ad2


COMMENTS

author: Jaidyn Nichols
date: 2012-01-07 01:04:01.000000000

Uploaded patch set 8.

-------------------------------------
author: Brenden Conley
date: 2012-01-07 01:13:02.000000000

Patch Set 8:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/2256/ 

-------------------------------------
author: Brenden Conley
date: 2012-01-07 01:26:48.000000000

Patch Set 8: I would prefer that you didn't submit this

Build Unstable 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/2256/ : UNSTABLE

-------------------------------------
author: Douglas Trujillo
date: 2012-01-07 11:05:54.000000000

Patch Set 8: I would prefer that you didn't submit this

(2 inline comments)

I only saw this single exception but I agree this looks like an unrelated problem.

I think this is a good step forward to improve project handling when switching branches.
Would be nice to have another option which would show the list of not yet imported projects when checking out another version (this could be also done when checking out a commit leading to a detached HEAD) so that the user has a chance to immediately import those he is interested in.

When running all UI tests (on Mac) I hit the following exception, though when only running the new test it succeeds

Rerun org.eclipse.egit.ui.test.AllLocalTests
org.eclipse.egit.ui.test.AllLocalTests
org.eclipse.egit.ui.internal.branch.BranchTests
org.eclipse.egit.ui.internal.branch.BranchProjectTrackerTest
twoProjectsWithOnlyOneOnBranch(org.eclipse.egit.ui.internal.branch.BranchProjectTrackerTest)
java.lang.AssertionError: expected:<0> but was:<2>
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.failNotEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:126)
	at org.junit.Assert.assertEquals(Assert.java:470)
	at org.junit.Assert.assertEquals(Assert.java:454)
	at org.eclipse.egit.ui.internal.branch.BranchProjectTrackerTest.twoProjectsWithOnlyOneOnBranch(BranchProjectTrackerTest.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner.run(SWTBotJunit4ClassRunner.java:54)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
	at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
	at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
	at java.lang.Thread.run(Thread.java:680)

Line:146, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java -> typo s/must the/must be the/

Line:15, /COMMIT_MSG -> typo s/preferences/preference/

-------------------------------------
author: Douglas Trujillo
date: 2012-01-07 11:35:47.000000000

Patch Set 8: (1 inline comment)



Line:170, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java -> findBugs: this is ignoring mkdir()'s return value, instead use FileUtils.mkdirs()

-------------------------------------
author: Jaidyn Nichols
date: 2012-01-07 17:52:12.000000000

Patch Set 8: (3 inline comments)

I also updated the unit test to clear the current preferences before running, I think that is why it was failing when run with the other tests.

Line:146, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java -> Done

Line:170, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ProjectUtil.java -> Done

Line:15, /COMMIT_MSG -> Done

-------------------------------------
