DESCRIPTION

Fixed 'Gitflow actions are only available on repositories and projects'

- activated Gitflow sub-menu for IResource and selection adaptable to
IResource

Bug: 482430
Change-Id: I1b162615ba008a75590c07a54f165421935fa41b
Signed-off-by: Jamarion Hunt xxx@xxx.xxx


COMMENTS

author: Jamarion Hunt
date: 2015-12-11 10:14:18.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-12-11 10:14:24.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2015-12-11 10:39:01.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/7938/ : UNSTABLE

-------------------------------------
author: Alayna Houston
date: 2015-12-11 19:02:53.000000000

Patch Set 1: Code-Review-1

(4 comments)

Line:47, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> (Not tested) Can't you do here:

  IResource resource = AdapterUtils.adapt(adaptableObject, IResource.class);
  if (resource != null) {
    repository = getRepository(resource);
  }

and then remove all those duplications in the plugin.xml?

Line:62, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> This should be Repository.class. The method is supposed to return the list of adapterTypes, i.e., the types to which this adapter can adapt objects to.

Line:252, org.eclipse.egit.gitflow.ui/plugin.xml -> I don't like all this duplication. Can't the adapter factory handle this? (See comment there.) Having these tests duplicated introduced additional opportunities for errors to creep in. (Update one but not the other.)

Line:717, org.eclipse.egit.gitflow.ui/plugin.xml -> This could be combined into one:

  <extension point="org.eclipse.core.runtime.adapters">
     <factory ...>...</factory>
     <factory ...>...</factory>
     <factory ...>...</factory>
  </extension>

-------------------------------------
author: Jamarion Hunt
date: 2015-12-13 20:33:22.000000000

Patch Set 1:

(4 comments)

Line:47, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> See comment in plugin.xml

Line:62, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> Done

Line:252, org.eclipse.egit.gitflow.ui/plugin.xml -> You are right, the duplication is awful. I intended to either refactor this, or find a better solution once it works completely (I have a few other outstanding commits on similar issues), and as soon as test coverage is up (see review 62455).

Your suggestion does not seem to work on CompilationUnit selections in the JDT package explorer, but I might be doing something wrong. If you can get it to work, I'd be glad to review it and abandon this one!

Line:717, org.eclipse.egit.gitflow.ui/plugin.xml -> If this commit is merged, I'll do a follow-up refactoring for this.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-12-16 09:21:29.000000000

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

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