Bug 300215 - [Sync View][Apply Patch] Inform when project from patch is not accessible
Summary: [Sync View][Apply Patch] Inform when project from patch is not accessible
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL: http://wiki.eclipse.org/Apply_patch_i...
Whiteboard:
Keywords:
Depends on:
Blocks: 236169
  Show dependency tree
 
Reported: 2010-01-20 11:53 EST by Tomasz Zarna CLA
Modified: 2010-03-11 05:34 EST (History)
1 user (show)

See Also:


Attachments
Fix v01 (2.78 KB, patch)
2010-02-09 07:01 EST, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (30.13 KB, application/octet-stream)
2010-02-09 07:01 EST, Tomasz Zarna CLA
no flags Details
Snap (18.49 KB, image/png)
2010-03-03 16:41 EST, Pawel Pogorzelski CLA
no flags Details
Patch_v01 (16.13 KB, patch)
2010-03-05 07:18 EST, Pawel Pogorzelski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2010-01-20 11:53:17 EST
Branch "branch_20091215_bug236169", but soon in HEAD (bug 298923).

User should be informed that project from a patch is not accessible (doesn't exist, is closed, etc). Current implementation in the branch will not display the project. This may be acceptable when applying a patch for a single project (user will get a suspicious message saying the patch contains no changes), but for multiple projects this may result in omitting part of the patch without noticing it.
Comment 1 Tomasz Zarna CLA 2010-02-02 07:11:20 EST
(In reply to comment #0)
> Current implementation in the branch will not display the project. 

This does no longer apply to the code in HEAD. If a project to-be-patched exists in the workspace but is closed the sync view will display the project as conflict. We can open the project, the synchronization will refresh and when all hunks are matched the conflict indicator will disappear. However, we are still missing an information that the conflict is caused by the project being closed. What is still true in comment 0 is that when the project does not exist in the workspace, it will not take part in the synchronization ie won't be displayed even as a conflicting change.
Comment 2 Tomasz Zarna CLA 2010-02-09 06:52:41 EST
In addition to comment 1, when a project to-be-patched is closed when sync'ing with a patch it will be displayed as a conflicting change, but after switching models it will disappear. This inconsistency is caused by the fact that ApplyPatchSubscriber.roots() returns all projects from the patch (no matter if they are accessible or not) but ResourceModelContentProvider does not return resources from inaccessible projects[1][2]. This is not an issue when closing the project, because there are two types of events sent then: removal and change (the closed project is still considered as root[3]) and the diff tree is not refreshed (calling SynchronizationContentProvider.getElements(Object)) but redrawn only.

I'm not sure how we should fix this. As the first step I would fix the inconsistency and ignore all projects that are not accessible. Having fixed that I would look for way to display closed/non-existent projects (decorated with a proper label).

[1] ResourceModelContentProvider.isInScope(ISynchronizationScope, Object, Object)
[2] SynchronizationContentProvider.getChildrenInContext(ISynchronizationContext, Object, Object[])
[3] SubscriberResourceCollector.processDelta(IResourceDelta, IResource[]) and SubscriberResourceCollector.isDescendantOfRoot(IResource, IResource[]) returning true
Comment 3 Tomasz Zarna CLA 2010-02-09 07:01:17 EST
Created attachment 158578 [details]
Fix v01

Fixed the inconsistency mentioned in comment 2.
Comment 4 Tomasz Zarna CLA 2010-02-09 07:01:50 EST
Created attachment 158579 [details]
mylyn/context/zip
Comment 5 Tomasz Zarna CLA 2010-02-19 06:53:28 EST
We had an offline chat and agreed that the best approach for now would be to sustain conclusion from comment 2 i.e. never display projects that are not accessible, but at the same time use a dialog or status line to inform that some projects from the patch are missing. 

The next step would be to open a separate bug where we could discuss how inaccessible projects should be presented in the Sync view. I think it's ok to address this after 3.6 ships.

Note, that when we decide to ignore inaccessible projects bug 301793 will become obsolete.

Pawel, please take this over, revisit Fix v01 and add a dialog or status line message (whatever you decide) mentioned above.
Comment 6 Pawel Pogorzelski CLA 2010-03-03 16:41:21 EST
Created attachment 160861 [details]
Snap

I've came up with adding a wizard page informing users that patch modifies non accessible projects. The page composes well into the current workflow and has additional advantage of allowing users to open closed projects.
Comment 7 Pawel Pogorzelski CLA 2010-03-03 16:43:41 EST
Also "Select All" and "Deselect All" buttons will appear in the final cut.
Comment 8 Pawel Pogorzelski CLA 2010-03-05 07:18:39 EST
Created attachment 161115 [details]
Patch_v01
Comment 9 Pawel Pogorzelski CLA 2010-03-05 07:19:16 EST
Patch_v01 in HEAD, marking as FIXED.
Comment 10 Pawel Pogorzelski CLA 2010-03-11 05:34:49 EST
Verified using I20100310-1800.