Bug 50965 - API Request: Allow setting team-private on resource creation
Summary: API Request: Allow setting team-private on resource creation
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: John Arthorne CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 64380 101457
  Show dependency tree
 
Reported: 2004-01-30 09:44 EST by Michael Valenta CLA Friend
Modified: 2006-01-18 15:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA Friend 2004-01-30 09:44:04 EST
Now that deltas can occur at any time, it is possible for a delta to occur 
between when a repository provider creates a team-private resource and when 
they mark it team-privte. This could be avoided if team-private could be 
specified as a flag on resource creation.
Comment 1 Michael Valenta CLA Friend 2004-04-05 15:32:40 EDT
The same problem exists for derived resources. The implications of this 
problem are:

- for CVS folders, they may appear in the navigator and will not be removed 
until the view is closed or Eclipse is restarted.

- for derived resources, they will appear in the sync view if the parent 
folder is under CVS control and will not be removed until another delta occurs 
on the file.
Comment 2 Philipe Mulet CLA Friend 2004-06-11 19:09:06 EDT
What is the likelyhood for this to be addressed within 3.0 ?
Comment 3 DJ Houghton CLA Friend 2004-06-14 12:56:30 EDT
There are no plans to add this API for 3.0.
Comment 4 Alexander Gurov CLA Friend 2005-11-23 12:27:12 EST
This bug is not really an API request. For example:
1) I have resources that are not team-private and it are shown in Navigator and Package Explorer.
2) I mark these resources as team-private, but it still shown in Navigator and Package Explorer.
3) I do some team operation that remove these resources from the file system
4) I do refresh on parent resource with IResource.DEPTH_INFINITE option (or simply by selecting pop-up menu "Refresh" item), but these resources still shown
5) Delete operation, called from pop-up menu, fails with exception for these resources (and this is right, really resources do not exists).
6) If I restarted Eclipse after resources are marked as team-private it are hided from views.
This problem could be greatly reduced after Navigator and Package Explorer handle change events for team-private members correctly. I.e. when resource is marked as team-private it should be removed from views and when this mark is removed it should be shown again.
These easily reproduced on Eclipse IDE 3.0.1 - 3.1.1
Comment 5 John Arthorne CLA Friend 2005-11-23 12:42:28 EST
Alexander, how are the resources marked team private in step two?  What team provider are you using?  The theory behind this request is that the team provider always knows it wants a given resource to be team private at creation time.  Your scenario suggests that a resource may be marked as team private by someone other than the one who created it.
Comment 6 Alexander Gurov CLA Friend 2005-11-25 08:30:47 EST
>What team provider are you using?
I use my own Team Provider. :) I.e. I'm are developer of a new Team Provider.

>how are the resources marked team private in step two
I mark all team private resources in subtree using following code:

public static void markTeamPrivateMembers(IResource node, boolean isTeamPrivate) throws CoreException {
	if (node instanceof IContainer) {
		if (IRemoteStorage.SVN_FOLDER_NAME.equals(node.getName())) {
			node.setTeamPrivateMember(true);
			node.refreshLocal(IResource.DEPTH_ONE, null);
		}
		IResource []children = ((IContainer)node).members();
		for (int i = 0; i < children.length; i++) {
			FileUtility.markTeamPrivateMembers(children[i], isTeamPrivate);
		}
	}
}

>Your scenario suggests that a resource may be marked as team private by
> someone other than the one who created it.
Yes, for example:
1) I import checked out project from the filesystem. 
2) I go to Navigator and open one of potential team-private resources
3) I attach this project to source control using Team Provider that marks all team-private resources
4) Team private resources which are already cached in UI still visible

That's all.
Comment 7 Alexander Gurov CLA Friend 2005-11-25 08:37:26 EST
Also I have ideas how team-private can be used "on the fly" to hide specific behaviour of some source control. I think that it is a good solution if team private status can be changed "on the fly" by Team Providers.
Comment 8 Alexander Gurov CLA Friend 2005-11-25 08:40:45 EST
Sorry, in the code that I post I do mistake, right line is:

....
node.setTeamPrivateMember(isTeamPrivate);
....
Comment 9 John Arthorne CLA Friend 2006-01-18 15:50:20 EST
API released (IResource.TEAM_PRIVATE).  Automated tests added to IFileTest and IFolderTest.