DESCRIPTION

Workaround to enable linking multiple resources to HistoryView

When given a selection the GenericHistoryView only considers the first
element and adapts it to an IResource before passing it on as input. To
work around this behavior the GitHistoryPage now looks at the current
selection itself and uses it as input if preferable.

Bug: 392948
Signed-off-by: Ronin Harrell xxx@xxx.xxx
Signed-off-by: Karter Mora xxx@xxx.xxx
Signed-off-by: Maleah Marks xxx@xxx.xxx
Signed-off-by: Corbin Edwards xxx@xxx.xxx
Signed-off-by: Maren Gonzales xxx@xxx.xxx
Change-Id: Idd3f2434881085d90a547f825fb20ba8895b7e79

COMMENTS

author: Maren Gonzales
date: 2017-01-16 09:56:17.000000000

Uploaded patch set 13.

-------------------------------------
author: Brenden Conley
date: 2017-01-16 09:56:24.000000000

Patch Set 13:

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

-------------------------------------
author: Brenden Conley
date: 2017-01-16 10:11:32.000000000

Patch Set 13: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/9512/ : FAILURE

-------------------------------------
author: Alayna Houston
date: 2017-01-17 09:50:37.000000000

Patch Set 13:

(1 comment)

Works well if the history view is visible, but if not, this doesn't work. GenericHistoryView then sets the input via showLastSelectedElement(), which again is only a single resource. Also, the selection obtained inside GitHistoryPage is then that page's own selection. To reproduce:

* Have both history and git staging view in the bottom right part stack.
* Have the history view visible.
* Select multiple resources in package explorer -> history view properly shows combined history.
* Click git staging tab.
* Select some different resources in package explorer.
* Click history tab -> history view shows only the history of the first selected element.

Perhaps the GitHistoryPage would have to track the last selection itself.

Line:1610, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java -> If the history view was not active, the part gets activated first and then the selection you get here is the selected SWTCommit from the history page's own CommitGraphTable.

-------------------------------------
author: Denise Bennett
date: 2017-04-19 13:28:01.000000000

Patch Set 13:

(1 comment)

Hi Thomas,

Thank you very much for your review! You are absolutely right, the implementation does not work in the case you described. After some investigation, I followed your advice and we now track the last selection ourselves and use this selection as input instead. Specifically, we register a selection listener instead of a post selection listener to ensure that we already have the correct selection before the GenericHistoryView's post selection listener triggers the showLastSelectdElement(). This solves the inconsistency you described. Thanks again!

Line:1610, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java -> You are right, this should be resolved by tracking the selection ourselves. Thank you for noticing!

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