DESCRIPTION

Fixed bug #406922: stronger checks for handling linked resources.

The fix provides stronger checks on selected linked resources before
enabling menu items. In particular, linked resources that point to a
file that is part of a project shared with egit are allowed to be
operated on. Otherwise team actions are disabled if the selection
contains a linked resource pointing to a file outside any project and
repository. A default isEnabled() implementation is provided for this
behavior. After adding a test case a couple more handlers have been
amended and made compliant.

Bug: 406922
Change-Id: Id9fd5ea0c31a78b84796638570d214d14cc3c4fd
Signed-off-by: Hamza Perez xxx@xxx.xxx

COMMENTS

author: Kade Schaefer
date: 2013-05-01 22:37:27.000000000

Patch Set 1:

As a self-employed freelance I'm the sole writer and owner of this code, and hereby donate it to eclipse under EPL.

-------------------------------------
author: Brenden Conley
date: 2013-05-01 22:37:50.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2013-05-01 22:55:52.000000000

Patch Set 1: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/4477/ : SUCCESS

-------------------------------------
author: Juliet Cantu
date: 2013-05-02 22:29:38.000000000

Patch Set 1: I would prefer that you didn't submit this

(4 inline comments)



Line:139, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java -> Odd. What does FB say?  It shouldn't complain if you just leave out hashCode. Why should it be here in the first place?

Line:146, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java -> not much point in having toString for non-parameterized test cases, is there and we don't have warnings enabled for test code so, why the comment?

Line:81, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> Good change on its own I believe or mention the implication for non-linked resources in the commit message,

Line:39, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java -> Good change on its own I believe or mention the implication for non-linked resources in the commit message,

-------------------------------------
author: Kade Schaefer
date: 2013-05-03 13:05:03.000000000

Patch Set 1: (4 inline comments)



Line:139, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java -> I just deleted this code: it's a leftover from DecoratableResourceAdapterTest.java which I used as a template to start with. Maybe we should do the same there.

Line:146, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java -> I just deleted this code: it's a leftover from DecoratableResourceAdapterTest.java which I used as a template to start with. Maybe we should do the same there.

Line:81, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> I believe this modification belongs to this change set: without it this action will be enabled when a linked resource that points to something outside a project and repository is selected. That's one of the class I had to change after creating the new unit test: it failed because the logic of isEnabled() was wrong. It was wrong because it used to test the repository of the project containing a linked resource instead of testing the repository containing the target resource.
What impact do you see on non-linked resources that should be mentioned?

Line:37, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java -> I believe this modification belongs to this change set: without it this action will be enabled when a linked resource that points to something outside a project and repository is part of the selection. That's one of the class I had to change after creating the new unit test.
What impact do you see on non-linked resources that should be mentioned?

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