DESCRIPTION

Allow to move changes in compare editor

All compare editors that compares working version against version in
index can now move particular hunk from left to right and other way
around. All changes are persisted to file system/git index after saving
compare results.

To add this functionality we need to wrap team's specific OpenInCompare
action into our own (GitOpenInCompare) action, because team framework
forces right hand side to be always read only. We want this writable
instead since we want to move changes from working copy to git index.

Change-Id: Ib38ee2d05934aa0f5cb9ddec9b5be91cbbe38759
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Leslie Stephenson
date: 2011-11-12 13:24:40.000000000

Uploaded patch set 11.

-------------------------------------
author: Brenden Conley
date: 2011-11-12 13:38:23.000000000

Patch Set 11:

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

-------------------------------------
author: Brenden Conley
date: 2011-11-12 13:52:30.000000000

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

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

-------------------------------------
author: Douglas Trujillo
date: 2011-11-17 23:31:30.000000000

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

(4 inline comments)

works like a charm :-)

it seems the following tests don't work any longer with this change (at least on Mac)


Rerun org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest.shouldOpenCompareEditor
shouldOpenCompareEditor(org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest)
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find widget.
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:348)
	at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editor(SWTWorkbenchBot.java:200)
	at org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editorByTitle(SWTWorkbenchBot.java:234)
	at org.eclipse.egit.ui.view.synchronize.AbstractSynchronizeViewTest.getCompareEditor(AbstractSynchronizeViewTest.java:333)
	at org.eclipse.egit.ui.view.synchronize.AbstractSynchronizeViewTest.getCompareEditorForFileInGitChangeSet(AbstractSynchronizeViewTest.java:257)
	at org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest.shouldOpenCompareEditor(SynchronizeViewGitChangeSetModelTest.java:128)
	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.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)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find editor matching: with name '"test.txt"'
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
	... 36 more

Rerun org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest.shouldShowCompareEditorForNonWorkspaceFileFromSynchronization
shouldShowCompareEditorForNonWorkspaceFileFromSynchronization(org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest)
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find widget.
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:348)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.widget(SWTBotFactory.java:308)
	at org.eclipse.swtbot.swt.finder.SWTBot.tree(SWTBot.java:1283)
	at org.eclipse.swtbot.swt.finder.SWTBot.tree(SWTBot.java:1272)
	at org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest.shouldShowCompareEditorForNonWorkspaceFileFromSynchronization(SynchronizeViewGitChangeSetModelTest.java:292)
	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.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)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find widget matching: (of type 'Tree')
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
	... 35 more

Line:85, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/GitCompareInput.java -> why are you moving this line ?

Line:559, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> typo in class name s/DirChacheEntryEditor/DirCacheEntryEditor/

Line:40, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingFile.java -> shouldn't we then better throw an exception to signal this ?

Line:2, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/GitOpenInCompareAction.java -> add "and others" as you mention a contribution from IBM

-------------------------------------
author: Brenden Conley
date: 2011-11-18 00:20:02.000000000

Patch Set 11: No score

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

-------------------------------------
author: Brenden Conley
date: 2011-11-18 00:35:02.000000000

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

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

-------------------------------------
author: Leslie Stephenson
date: 2011-11-18 19:57:29.000000000

Patch Set 11: (4 inline comments)

Both tests cases should be fixed by change Ibec45472d5b8115e1520caa521516dea9d156b6b and I13348bc9ac621193f38ae52855354b3a866e7cbe. To be honest, I'm personally not sure if those changes should be squashed together, by I can do that if you prefer handle this such way.

Line:85, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/compare/GitCompareInput.java -> It was move by mistake.

Line:559, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> Done

Line:40, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingFile.java -> Done

Line:2, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/action/GitOpenInCompareAction.java -> Done

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