DESCRIPTION

user can change to local branch when fetching Gerrit changes

When attempting to fetch a Gerrit patch set which the user has already
fetched they are now presented with an option to change to the already
fetched branch. This is the default option if a local branch exists. If
no local branch exists for a ref this option is not available.

Bug: 509181
Change-Id: I81af2906fe44dacb35ca9c23e4cd2583750f3b8a
Signed-off-by: Megan Mccormick xxx@xxx.xxx

COMMENTS

author: Megan Mccormick
date: 2016-12-18 07:55:23.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-12-18 07:55:29.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2016-12-18 08:18:58.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2016-12-18 13:09:13.000000000

Patch Set 1: Code-Review-1

(3 comments)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/Change.java -> if you want to extract the inner class do that in a separate refactoring change and base this change on the refactoring change

Line:26, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/Change.java -> I hit an NPE when trying to fetch a change from Gerrit here:

 org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:433)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:454)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$3.handleEvent(AbstractContributionItem.java:482)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4248)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1313)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	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:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	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:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.fetch.Change.fromRef(Change.java:26)
	at org.eclipse.egit.ui.internal.fetch.FetchGerritChangePage.getLocalRef(FetchGerritChangePage.java:618)
	at org.eclipse.egit.ui.internal.fetch.FetchGerritChangePage.createControl(FetchGerritChangePage.java:354)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:175)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:696)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:588)
	at org.eclipse.jface.window.Window.create(Window.java:426)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1095)
	at org.eclipse.jface.window.Window.open(Window.java:783)
	at org.eclipse.egit.ui.internal.commands.shared.FetchChangeFromGerritCommand.execute(FetchChangeFromGerritCommand.java:45)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	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:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	... 40 more

Line:660, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java -> this improvement is unrelated to this change, move it to a separate change

-------------------------------------
author: Megan Mccormick
date: 2016-12-19 08:33:23.000000000

Patch Set 1:

(1 comment)

I'll take out the refactoring of the Change class.

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

-------------------------------------
author: Douglas Trujillo
date: 2017-01-10 00:57:43.000000000

Patch Set 1:

(3 comments)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/Change.java -> reverted extraction

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

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

-------------------------------------
author: Gerrit Johnathan Pham
date: 2017-03-06 22:56:23.000000000

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

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