DESCRIPTION

Multi select support for Switch to-> (common branch or new)

This patch makes the Switch to menu item available for many repositories
at once, it does find the common names and list all those and switches
all repositories to it when one is selected, it can also create a common
branch over all of them.

Change-Id: I58d3717667856be5ac18a03a3dd65d8c2bfe728f
Signed-off-by: Karen Livingston xxx@xxx.xxx


COMMENTS

author: Karen Livingston
date: 2017-01-03 14:10:02.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2017-01-03 14:10:08.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2017-01-03 14:33:51.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Alayna Houston
date: 2017-01-06 15:21:07.000000000

Patch Set 2: Code-Review-1

(13 comments)

Line:76, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java -> Missing braces.

Line:128, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java -> Missing braces.

Line:3041, org.eclipse.egit.ui/plugin.xml -> This menu also appears in the package explorer on projects. Should it also be enabled there if projects from several repositories are selected?

(It also appears on files and folders, but for those I presume we may keep the single repository restriction.)

Line:384, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java -> Missing braces.

Line:81, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> If it's a single repository, why return an array?

Line:262, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Not true for this method.

Line:270, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Javadoc is wrong.

Line:276, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> This should be a Set to avoid duplicates.

Line:278, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Missing braces.

Line:293, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Could be replaced safely with

  Repository repo = ResourceUtil.getRepository(location);

But we've used the getSelectionContents() way below on purpose; finding the repository for an IResource is faster if we can go through the RepositoryMapping than converting to IPath and then trying to find the repo through that.

I just noticed that lines 371 to 385 are most likely not needed anymore since getSelectionContents() already adapts to Repository.

Line:299, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Use isEmpty() instead of size() == 0.

Line:309, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Missing braces.

Line:135, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java -> Not sure about the UI here (and also below where BranchOperationUI is called in a loop).

What should happen if the newBranchName already exists in some of the repositories?

-------------------------------------
author: Karen Livingston
date: 2017-01-06 16:10:00.000000000

Patch Set 2:

line 3041: personally i don't care to much about this, i think creating branches and so on is way better handled in the Repository View. So do we really want to have also this supports on multi select in any other view ?

line 135: so if you type in a new branch name, first check if that one is not already there on all the selected repositories?

-------------------------------------
author: Karen Livingston
date: 2017-01-06 16:35:02.000000000

Patch Set 2:

(10 comments)

i pushed a patch for the that stuff, i still used the old implementation for getting a repo, copied it over now from the new one.
By the way, a lot of no {} where from copied code ;)

Line:76, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java -> Done

Line:128, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java -> Done

Line:384, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java -> Done

Line:81, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:262, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:270, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:276, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:278, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:299, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

Line:309, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> Done

-------------------------------------
author: Alayna Houston
date: 2017-01-07 13:47:08.000000000

Patch Set 2:

(1 comment)

Line:135, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java -> What I meant is that I don't like throwing multiple dialogs at the user. Re-using the "create single branch" wizard here doesn't seem like a good design choice. I'd much prefer a single wizard allowing the user to create the branch in all repositories, if it doesn't exist already. For instance something like this mock-up: http://imgur.com/a/wRHvt .

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