Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 105077

Summary: Need a CVSLightweightDecorator.isDirty(ResourceMapping)
Product: [Eclipse Project] Platform Reporter: Randy Hudson <hudsonr>
Component: CVSAssignee: Michael Valenta <Michael.Valenta>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.1   
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Randy Hudson CLA 2005-07-25 16:44:54 EDT
When I enable Show/Working Sets, I should be able to see outgoing changes on the
working sets. I have a filter for this view which only shows outgoing changes
and it is broken because of this new view. Basically, the view is empty when
"show working sets" is enabled because no working sets are dirty.
Comment 1 Randy Hudson CLA 2005-07-25 16:45:59 EDT
If working sets are being passed to the filters, then maybe this is a bug in the
CVS label decorator.
Comment 2 Dirk Baeumer CLA 2005-07-26 06:49:21 EDT
Working sets are passed to the filter. 

Michael, is there anything JDT/UI can do to consider working sets during label
decoration. If not is there something Team can do (there will be a plan item to
improve working set support in Platform so this would fit into this item).

Moving to Team/CVS for comments. 
Comment 3 Michael Valenta CLA 2005-08-03 17:03:53 EDT
I've been working on support for this and hope to get it into 3.2 M1
Comment 4 Michael Valenta CLA 2005-08-04 14:48:55 EDT
The fix for bug 3979 makes this possible but there are still some issues as 
outlined in bug 86493. Marking this a dup of that bug.

*** This bug has been marked as a duplicate of 86493 ***
Comment 5 Randy Hudson CLA 2005-08-08 10:43:15 EDT
> Working sets are passed to the filter. 

Maybe they shouldn't be?
Comment 6 Michael Valenta CLA 2005-08-08 10:50:43 EDT
Randy, what check does your filter perform to see if the item hs outgoing 
changes?
Comment 7 Randy Hudson CLA 2005-08-08 11:03:49 EDT
I'm calling internals from CVS:
if (resource != null && CVSWorkspaceRoot.isSharedWithCVS(resource)
	&& CVSLightweightDecorator.isDirty(resource))
    return true;

First I check for an instance of IResource, so maybe I'm not getting that far?
Comment 8 Michael Valenta CLA 2005-08-08 11:41:26 EDT
Once we get all the decorator stuff worked out, I'll provide a method that 
allows you to query the dirty state for a ResourceMapping. Thus, you will be 
able to determine the state for any item that adapts to a resource mapping.
Comment 9 Michael Valenta CLA 2006-01-11 16:30:13 EST
I have released support for this to HEAD. The new API exposes the synchronization state of a RepositoryProvider to clients. RepositoryProviders can choose whether to provide the API (which CVS does).

The following code snippet should give you an idea of how to use the API for what you want.

if (resource != null && CVSWorkspaceRoot.isSharedWithCVS(resource)) {
    RespositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
    Subscriber subscriber = provider.getSubscriber();
    isDirty = subscriber.hasOutgoingChange(asResourceTraversal(resource));
}
Comment 10 Michael Valenta CLA 2006-01-16 10:43:17 EST
The API has changed a bit. hasOutgoingChange has been replaced by a getState that takes a mask. Using a mask of IThreeWayDiff.OUTGOING should give you what you want.