DESCRIPTION

Interactive rebase view toolbar can incorrectly activate buttons

Currently interactive rebase view plan toolbar can incorrectly handle
changeset table selection changes in case of multiple selected
changesets.
RebaseInteractiveStepActionToolBarProvider#mapActionItemsToSelection
activates corresponding button on the toolbar in case of single
selection and can deactivate all buttons in case on multi selection (if
selected changesets have different rebasing plans). Current
implementation does not handle situation in which another button needs
to be activated. For example, if previously selected changeset had
"reword" plan ("reword" button activated) and new selection is two
changesets with "fixup" plan then expected behaviour is to activate
"fixup" button, but actually "reword" button will remain activated. 

Proposed implementation always activates button corresponding to the
first selected changeset plan and deactivates this button if necessary
(i.e. selected changesets have different plans).

Bug: 441891
Change-Id: Ic6013d2857e8dfc439650692e2ee22031e6f61ec
Signed-off-by: Anahi Horn xxx@xxx.xxx


COMMENTS

author: Anahi Horn
date: 2014-08-16 12:51:43.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-08-16 12:56:46.000000000

Patch Set 4:

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

-------------------------------------
author: Kaden Henson
date: 2014-08-16 12:57:53.000000000

Patch Set 4: Code-Review+1

-------------------------------------
author: Brenden Conley
date: 2014-08-16 13:13:11.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Danika Greer
date: 2014-08-21 12:38:25.000000000

Patch Set 4: Code-Review-1

(3 comments)

There's still a problem with the move buttons, see inline comment.

Line:267, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveStepActionToolBarProvider.java -> While we're in here, could you replace that with this:

  for (Object selectedObj : structured.toList()) {

Line:270, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveStepActionToolBarProvider.java -> This code isn't from you, but maybe you didn't see the break problem below because there was an extra assignment hidden here, let's replace it while we're at it:

  PlanElement entry = (PlanElement) selectedObj;
  lastSelectedEntry = entry;

Line:273, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/rebase/RebaseInteractiveStepActionToolBarProvider.java -> This causes the lastSelectedEntry to be wrong as the loop can be terminated before the last selected entry was reached. Remove the break to fix it. (It's not really your fault as this whole code was already unreadable before.)

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