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-06 16:32:29.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2017-01-06 16:32:35.000000000

Patch Set 3:

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

-------------------------------------
author: Alayna Houston
date: 2017-01-06 16:48:19.000000000

Patch Set 3:

> By the way, a lot of no {} where from copied code ;)

I know. EGit switched some time ago,[1] but there was no mass clean-up. Instead we fix it whenever we touch old code anyway, and we enforce it for new code.

[1] https://wiki.eclipse.org/EGit/Contributor_Guide#Braces_for_one-line_statements

-------------------------------------
author: Brenden Conley
date: 2017-01-06 16:55:49.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2017-01-07 00:33:57.000000000

Patch Set 3: Code-Review-1

(1 comment)

Line:81, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> You still state this method returns a single repository but the method returns an array. So either javadoc is wrong or your should return a single Repository instance and not an array

-------------------------------------
author: Alayna Houston
date: 2017-01-07 14:02:08.000000000

Patch Set 3:

(2 comments)

Line:295, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> I don't like this code duplication. Rewrite the existing getRepository() as

  /**
   * Determines the selected repository or repositories.
   * Returns an empty collection if an element of the
   * selection does not belong to any git repository.
   * If allow_multiple is true, returns a collection
   * containing all repositories, without duplicates.
   * If allow_multiple is false, return either a collection
   * containing the single repository, or a collection of
   * two repositories (the first and second one found).
   *
   xxx@xxx.xxx ...
   xxx@xxx.xxx ...
   */
  private static Collection<Repository> xxx@xxx.xxx IStructuredSelection selection, boolean allow_multiple) {
    ...
  }

Replace uses of the old getRepository by the new one; warn as appropriate in getRepositoryOrWarn() above. Use the new method in the new public getRepositories() function.

Line:304, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/SelectionUtils.java -> This whole block should not be necessary. getSelectionContents() already takes care of the adaptation to Repository.

-------------------------------------
author: Alayna Houston
date: 2017-01-08 10:07:00.000000000

Patch Set 3:

(1 comment)

Line:76, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java -> This is always null (default initialized) here.

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