DESCRIPTION

Fetch from Gerrit: checkout branch after resolving checkout conflicts

Ensure that new change branch is checked out after using Reset, Commit,
Stash or OK to cleanup uncommitted changes.

Bug: 507494
Change-Id: I8e085cad3c79a866cd8d1770854b24e8bad5d9b7
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2017-02-23 13:59:28.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2017-02-23 13:59:34.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2017-02-23 14:23:58.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/9606/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2017-02-26 08:20:39.000000000

Patch Set 3:

(2 comments)

Looks good, works well. Just minor comments on the monitor stuff.

Line:838, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> I don't think this is needed.

Line:841, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Conversion to SubMonitor will consume everything anyway, so we don't need this.

-------------------------------------
author: Alayna Houston
date: 2017-02-26 09:57:37.000000000

Patch Set 3: Code-Review-2

(2 comments)

Actually,it's not looking good. Missed that at first. When I stash the uncommitted changes, everything works, but I get the following exception logged:

  !ENTRY org.eclipse.ui 4 0 2017-02-26 10:39:25.935
  !MESSAGE Unhandled event loop exception
  !STACK 0
  org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4533)
	at org.eclipse.swt.SWT.error(SWT.java:4448)
	at org.eclipse.swt.SWT.error(SWT.java:4419)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:799)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:588)
	at org.eclipse.swt.widgets.Control.getShell(Control.java:1951)
	at org.eclipse.jface.wizard.WizardDialog$2.setBlocked(WizardDialog.java:640)
	at org.eclipse.jface.operation.AccumulatingProgressMonitor.lambda$3(AccumulatingProgressMonitor.java:244)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4033)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1133)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:684)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

The whole FetchGerritChangeWizard is closed too early. Using the monitor in the join for the second checkout() then produces this exception. Probably can't use asyncExec here.

Line:810, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Is creating the local branch really 80% of the work? Typically checking out would take more time, wouldn't it?

Line:820, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> This cause the exception, I suppose. When we join in the second checkout(), the wizard is already closed.

-------------------------------------
author: Alayna Houston
date: 2017-02-26 11:18:12.000000000

Patch Set 3:

(4 comments)

There's a much simpler way to achieve this: re-use BranchOperationUI. See comments on the base version.

Might need a little clean-up regarding the launch checking, since BranchOperationUI also does this. So probably it may simply be removed here.

Line:751, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> commit.name()

Line:811, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Actually, the real problem is that this tries to do the checkout directly. Re-use BranchOperationUI here; it already handles all this. Just do the SubMonitor conversion, then here:

  if (doCheckout) {
    checkout(textForBranch, progress.newChild(1));
  }

Line:833, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Change to

  String targetName

Line:836, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> targetName

-------------------------------------
author: Douglas Trujillo
date: 2017-02-26 14:37:34.000000000

Patch Set 3:

(6 comments)

Line:751, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

Line:811, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

Line:833, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

Line:836, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

Line:810, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

Line:820, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> Done

-------------------------------------
author: Gerrit Johnathan Pham
date: 2017-02-28 19:37:10.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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