Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 207795 Details for
Bug 41929
[Commands] CVS ignores linked resources
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch for CVS trunk
patch_cvs.txt (text/plain), 221.06 KB, created by
Serge Beauchamp
on 2011-12-01 10:56:02 EST
(
hide
)
Description:
Updated patch for CVS trunk
Filename:
MIME Type:
Creator:
Serge Beauchamp
Created:
2011-12-01 10:56:02 EST
Size:
221.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.core >Index: src/org/eclipse/team/internal/ccvs/core/CVSMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMessages.java,v >retrieving revision 1.21 >diff -u -r1.21 CVSMessages.java >--- src/org/eclipse/team/internal/ccvs/core/CVSMessages.java 21 Apr 2011 13:03:23 -0000 1.21 >+++ src/org/eclipse/team/internal/ccvs/core/CVSMessages.java 1 Dec 2011 15:00:48 -0000 >@@ -166,6 +166,7 @@ > public static String CVSRepositoryLocation_hostRequired; > public static String CVSRepositoryLocation_rootRequired; > public static String CVSRepositoryLocation_noAuthenticator; >+ public static String CVSRepositoryLocation_mixedRepository; > > public static String Util_timeout; > public static String Util_processTimeout; >@@ -189,6 +190,7 @@ > public static String CVSProvider_Scrubbing_projects_1; > public static String CVSProvider_Creating_projects_2; > >+ public static String Resource_not_in_CVS; > public static String EclipseFile_Problem_deleting_resource; > public static String EclipseFile_Problem_accessing_resource; > public static String EclipseFile_Problem_writing_resource; >Index: src/org/eclipse/team/internal/ccvs/core/CVSStatus.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSStatus.java,v >retrieving revision 1.33 >diff -u -r1.33 CVSStatus.java >--- src/org/eclipse/team/internal/ccvs/core/CVSStatus.java 24 Apr 2009 09:33:21 -0000 1.33 >+++ src/org/eclipse/team/internal/ccvs/core/CVSStatus.java 1 Dec 2011 15:00:48 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.team.internal.ccvs.core; > > import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.core.TeamStatus; >@@ -45,6 +46,7 @@ > > // Path for resource related status > private ICVSFolder commandRoot; >+ private IPath commandPath; > // Server information > private ICVSRepositoryLocation cvsLocation; > >@@ -65,6 +67,11 @@ > this(severity, code, message, null, resource); > } > >+ public CVSStatus(int severity, int code, String message, IPath path) { >+ this(severity, code, message, null, (IResource) null); >+ commandPath = path; >+ } >+ > public CVSStatus(int severity, int code, String message, Throwable t, ICVSFolder commandRoot) { > super(severity, CVSProviderPlugin.ID, code, message, t, null); > this.commandRoot = commandRoot; >@@ -94,6 +101,9 @@ > if (commandRoot != null) { > message = NLS.bind(CVSMessages.CVSStatus_messageWithRoot, new String[] { commandRoot.getName(), message }); > } >+ if (commandPath != null) { >+ message = NLS.bind(CVSMessages.CVSStatus_messageWithRoot, new String[] { commandPath.toString(), message }); >+ } > return message; > } > >Index: src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java,v >retrieving revision 1.193 >diff -u -r1.193 CVSTeamProvider.java >--- src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java 9 Oct 2009 07:34:09 -0000 1.193 >+++ src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java 1 Dec 2011 15:00:48 -0000 >@@ -685,6 +685,7 @@ > } > > private IStatus internalValidateCreateLink(IResource resource) { >+ /* Allow creating linked resources of files already included in source repository. > ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor(resource.getParent().getFolder(new Path(resource.getName()))); > try { > if (cvsFolder.isCVSFolder()) { >@@ -700,7 +701,8 @@ > } catch (CVSException e) { > CVSProviderPlugin.log(e); > return e.getStatus(); >- } >+ }*/ >+ > return Status.OK_STATUS; > } > >Index: src/org/eclipse/team/internal/ccvs/core/ICVSResource.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java,v >retrieving revision 1.17 >diff -u -r1.17 ICVSResource.java >--- src/org/eclipse/team/internal/ccvs/core/ICVSResource.java 10 May 2006 18:42:10 -0000 1.17 >+++ src/org/eclipse/team/internal/ccvs/core/ICVSResource.java 1 Dec 2011 15:00:49 -0000 >@@ -12,7 +12,9 @@ > > > import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.team.core.RepositoryProvider; > import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; > > /** >@@ -40,6 +42,14 @@ > public String getName(); > > /** >+ * Returns the location of a resource in the file system, if it exists. >+ * >+ * @return the location of the resource this handle represents. It can >+ * be <code>null</code>. >+ */ >+ public IPath getLocation(); >+ >+ /** > * Answers if this resource has CVS synchronization information associated > * with it. > * >@@ -170,4 +180,10 @@ > * @return boolean > */ > public boolean isModified(IProgressMonitor monitor) throws CVSException; >+ >+ /** >+ * Method isModified. >+ * @return boolean >+ */ >+ public RepositoryProvider getProvider(); > } >Index: src/org/eclipse/team/internal/ccvs/core/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties,v >retrieving revision 1.177 >diff -u -r1.177 messages.properties >--- src/org/eclipse/team/internal/ccvs/core/messages.properties 21 Apr 2011 13:03:23 -0000 1.177 >+++ src/org/eclipse/team/internal/ccvs/core/messages.properties 1 Dec 2011 15:00:49 -0000 >@@ -163,7 +163,7 @@ > CVSRepositoryLocation_hostRequired=A host name is required to make a connection > CVSRepositoryLocation_rootRequired=A root path is required to make a connection > CVSRepositoryLocation_noAuthenticator=No CVS authenticator is registered >- >+CVSRepositoryLocation_mixedRepository=Projects resources belong to different cvs repositories > > Util_timeout=A timeout occurred connecting to host {0} > Util_processTimeout=A timeout occurred executing command ''{0}'' >@@ -190,6 +190,7 @@ > CVSProvider_Scrubbing_projects_1=Scrubbing projects > CVSProvider_Creating_projects_2=Creating projects > >+Resource_not_in_CVS=Not CVS File: {0} ({1}) > EclipseFile_Problem_deleting_resource=Problem deleting resource: {0}. {1} > EclipseFile_Problem_accessing_resource=Problem accessing resource: {0}. {1} Perform a Refresh. > EclipseFile_Problem_writing_resource=Problem writing resource ''{0}''. {1} >Index: src/org/eclipse/team/internal/ccvs/core/client/Command.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java,v >retrieving revision 1.78 >diff -u -r1.78 Command.java >--- src/org/eclipse/team/internal/ccvs/core/client/Command.java 21 Jun 2007 14:56:11 -0000 1.78 >+++ src/org/eclipse/team/internal/ccvs/core/client/Command.java 1 Dec 2011 15:00:49 -0000 >@@ -13,8 +13,8 @@ > > import java.util.*; > >-import org.eclipse.core.resources.IFile; >-import org.eclipse.core.resources.IResource; >+import org.eclipse.core.filesystem.URIUtil; >+import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.internal.ccvs.core.*; >@@ -309,11 +309,13 @@ > // print the invocation string to the console > if (session.isOutputToConsole() || Policy.isDebugProtocol()) { > IPath commandRootPath; >- IResource resource = session.getLocalRoot().getIResource(); >- if (resource == null) { >- commandRootPath = Path.EMPTY; >- } else { >- commandRootPath = resource.getFullPath(); >+ commandRootPath = session.getLocalRoot().getLocation(); >+ if (commandRootPath == null) >+ commandRootPath = Path.EMPTY; >+ else { >+ IContainer[] containers = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(URIUtil.toURI(commandRootPath)); >+ if (containers.length > 0) >+ commandRootPath = containers[0].getFullPath(); > } > String line = constructCommandInvocationString(commandRootPath, gOptions, lOptions, arguments); > ConsoleListeners.getInstance().commandInvoked(session, line); >Index: src/org/eclipse/team/internal/ccvs/core/client/Session.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java,v >retrieving revision 1.103 >diff -u -r1.103 Session.java >--- src/org/eclipse/team/internal/ccvs/core/client/Session.java 16 Mar 2007 21:03:49 -0000 1.103 >+++ src/org/eclipse/team/internal/ccvs/core/client/Session.java 1 Dec 2011 15:00:49 -0000 >@@ -12,18 +12,10 @@ > package org.eclipse.team.internal.ccvs.core.client; > > import java.io.*; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.Collection; >-import java.util.Date; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >- >+import java.util.*; > import java.util.zip.GZIPInputStream; > import java.util.zip.GZIPOutputStream; > >-import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.core.RepositoryProvider; >@@ -921,13 +913,10 @@ > } > // If there is a provider, use the providers setting for watch/edit > try { >- IResource resource = getLocalRoot().getIResource(); >- if (resource != null && resource.getType() != IResource.ROOT) { >- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); >+ RepositoryProvider provider = getLocalRoot().getProvider(); > if (provider != null) { > return ((CVSTeamProvider) provider).isWatchEditEnabled(); > } >- } > } catch (CVSException e) { > CVSProviderPlugin.log(e); > } >Index: src/org/eclipse/team/internal/ccvs/core/client/Update.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java,v >retrieving revision 1.36 >diff -u -r1.36 Update.java >--- src/org/eclipse/team/internal/ccvs/core/client/Update.java 16 Mar 2007 21:03:49 -0000 1.36 >+++ src/org/eclipse/team/internal/ccvs/core/client/Update.java 1 Dec 2011 15:00:49 -0000 >@@ -11,11 +11,8 @@ > package org.eclipse.team.internal.ccvs.core.client; > > >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.List; >+import java.util.*; > >-import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.osgi.util.NLS; >@@ -124,19 +121,15 @@ > */ > protected boolean shouldRetrieveAbsentDirectories(Session session) { > // Look for absent directories if enabled and the option is not already included >- IResource resource = null; > RepositoryProvider provider = null; > // If there is a provider, use the providers setting > try { >- resource = session.getLocalRoot().getIResource(); >- if (resource != null) { >- provider = RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); >+ provider = session.getLocalRoot().getProvider(); > if (provider != null) { > if (((CVSTeamProvider)provider).getFetchAbsentDirectories()) { > return true; > } > } >- } > } catch (CVSException e) { > CVSProviderPlugin.log(e); > } >Index: src/org/eclipse/team/internal/ccvs/core/resources/CVSFileSystemRoot.java >=================================================================== >RCS file: src/org/eclipse/team/internal/ccvs/core/resources/CVSFileSystemRoot.java >diff -N src/org/eclipse/team/internal/ccvs/core/resources/CVSFileSystemRoot.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/internal/ccvs/core/resources/CVSFileSystemRoot.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,42 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.internal.ccvs.core.resources; >+ >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.team.core.RepositoryProvider; >+import org.eclipse.team.internal.ccvs.core.*; >+ >+/** >+ * This class provides static methods for checking out projects from a repository >+ * into the local file system (not necessarily mappable to a workspace resource) >+ * and for converting IPaths into CVSRespources and sync trees. >+ * Instances of this class represent a local workspace root (i.e. a project). >+ */ >+public class CVSFileSystemRoot { >+ >+ public CVSFileSystemRoot(){ >+ } >+ >+ public static ICVSFolder getCVSFolderFor(IPath resource, RepositoryProvider repositoryProvider) { >+ return new FileSystemFolder(resource, repositoryProvider); >+ } >+ >+ public static ICVSFile getCVSFileFor(IPath resource, RepositoryProvider repositoryProvider) { >+ return new FileSystemFile(resource, repositoryProvider); >+ } >+ >+ public static ICVSResource getCVSResourceFor(IPath resource, RepositoryProvider repositoryProvider) { >+ if (resource.toFile().isFile()) >+ return getCVSFileFor(resource, repositoryProvider); >+ else >+ return getCVSFolderFor(resource, repositoryProvider); >+ } >+} >Index: src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java,v >retrieving revision 1.56 >diff -u -r1.56 CVSWorkspaceRoot.java >--- src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java 16 Mar 2007 21:03:48 -0000 1.56 >+++ src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java 1 Dec 2011 15:00:52 -0000 >@@ -236,7 +236,6 @@ > */ > public static boolean isSharedWithCVS(IResource resource) throws CVSException { > if (!resource.isAccessible()) return false; >- if(isLinkedResource(resource)) return false; > > if(RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()) == null) { > return false; >Index: src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java,v >retrieving revision 1.78 >diff -u -r1.78 EclipseFile.java >--- src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java 4 Feb 2011 11:13:18 -0000 1.78 >+++ src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java 1 Dec 2011 15:00:52 -0000 >@@ -11,8 +11,7 @@ > *******************************************************************************/ > package org.eclipse.team.internal.ccvs.core.resources; > >-import java.io.File; >-import java.io.InputStream; >+import java.io.*; > import java.util.ArrayList; > import java.util.Date; > import java.util.List; >@@ -185,6 +184,26 @@ > break; > case MERGED: // merging contents into a file that exists locally > // Ensure we don't leave the file in a partially written state >+ if (file.isLinked()) { >+ IPath fileLocation = file.getLocation(); >+ IPath tempFile = file.getLocation().removeLastSegments(1).append(file.getName() + TEMP_FILE_EXTENSION); >+ File javaTempFile = tempFile.toFile(); >+ if (javaTempFile.exists()) >+ javaTempFile.delete(); >+ ByteArrayOutputStream os = new ByteArrayOutputStream(); >+ int nextByte; >+ while ((nextByte = stream.read() ) != -1) { >+ os.write((byte) nextByte); >+ } >+ RandomAccessFile raFile = new RandomAccessFile(javaTempFile, "rw"); //$NON-NLS-1$ >+ raFile.write(os.toByteArray()); >+ raFile.setLength(os.toByteArray().length); >+ raFile.close(); >+ fileLocation.toFile().delete(); >+ javaTempFile.renameTo(fileLocation.toFile()); >+ file.refreshLocal(IResource.DEPTH_ZERO, Policy.subMonitorFor(monitor, 100)); >+ } >+ else { > IFile tempFile = file.getParent().getFile(new Path(null, file.getName() + TEMP_FILE_EXTENSION)); > monitor.beginTask(null, 100); > if (tempFile.exists()) >@@ -192,12 +211,15 @@ > tempFile.create(stream, true /*force*/, Policy.subMonitorFor(monitor, 25)); > file.delete(false /* force */, true /* keep history */, Policy.subMonitorFor(monitor, 25)); > tempFile.move(new Path(null, file.getName()), false /*force*/, true /*history*/, Policy.subMonitorFor(monitor, 25)); >+ } > monitor.done(); > break; > case UPDATE_EXISTING: // creating a new file so it should exist locally > file.setContents(stream, false /*force*/, true /*keep history*/, monitor); > break; > } >+ } catch(IOException e) { >+ throw CVSException.wrapException(e); > } catch(CoreException e) { > String message = null; > if (e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) { >Index: src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java,v >retrieving revision 1.75 >diff -u -r1.75 EclipseFolder.java >--- src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java 10 May 2006 18:41:55 -0000 1.75 >+++ src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java 1 Dec 2011 15:00:52 -0000 >@@ -350,8 +350,10 @@ > boolean modified; > if (state == ICVSFile.UNKNOWN) { > >+ if (getLocation() != null) { > if (!isCVSFolder() && container.getType() == IResource.FOLDER) { > return container.exists(); >+ } > } > > // We have no cached info for the folder. We'll need to check directly, >Index: src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java,v >retrieving revision 1.51 >diff -u -r1.51 EclipseResource.java >--- src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java 16 Mar 2007 21:03:48 -0000 1.51 >+++ src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java 1 Dec 2011 15:00:52 -0000 >@@ -13,6 +13,7 @@ > > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; >+import org.eclipse.team.core.RepositoryProvider; > import org.eclipse.team.core.Team; > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.Session; >@@ -55,10 +56,13 @@ > */ > public String getRelativePath(ICVSFolder root) throws CVSException { > try { >- EclipseResource rootFolder; > String result; >- rootFolder = (EclipseResource)root; >+ if (root instanceof EclipseResource) { >+ EclipseResource rootFolder = (EclipseResource)root; > result = Util.getRelativePath(rootFolder.getPath(), getPath()); >+ } else >+ result = Util.getRelativePath(root.getLocation(), getLocation()); >+ > if (result.length() == 0) return CURRENT_LOCAL_FOLDER; > return result; > } catch (ClassCastException e) { >@@ -85,6 +89,11 @@ > if (parent==null) { > return null; > } >+ if (getLocation() != null) { >+ IPath fileSystemParent = getLocation().removeLastSegments(1); >+ if (!fileSystemParent.equals(parent.getLocation())) >+ return CVSFileSystemRoot.getCVSFolderFor(fileSystemParent, getProvider()); >+ } > return new EclipseFolder(parent); > } > >@@ -104,8 +113,8 @@ > return false; > } > >- // If the resource is a derived or linked resource, it is ignored >- if (resource.isDerived() || resource.isLinked()) { >+ // If the resource is a derived resource, it is ignored >+ if (resource.isDerived()) { > return true; > } > >@@ -165,7 +174,7 @@ > if (!(obj instanceof EclipseResource)) { > return false; > } else { >- return getPath().equals(((EclipseResource) obj).getPath()); >+ return getLocation().equals(((EclipseResource) obj).getLocation()); > } > } > >@@ -176,6 +185,10 @@ > return resource.getFullPath().toString(); > } > >+ public IPath getLocation() { >+ return resource.getLocation(); >+ } >+ > /* > * @see ICVSResource#isFolder() > */ >@@ -187,6 +200,8 @@ > * @see org.eclipse.team.internal.ccvs.core.ICVSFile#getSyncBytes() > */ > public byte[] getSyncBytes() throws CVSException { >+ if (getLocation() == null) >+ return null; > return EclipseSynchronizer.getInstance().getSyncBytes(getIResource()); > } > >@@ -194,6 +209,8 @@ > * @see org.eclipse.team.internal.ccvs.core.ICVSFile#setSyncBytes(byte[]) > */ > public void setSyncBytes(byte[] syncBytes) throws CVSException { >+ if (resource.getType() == IResource.ROOT || resource.getType() == IResource.PROJECT) >+ return; > if (getParent().isCVSFolder()) { > EclipseSynchronizer.getInstance().setSyncBytes(getIResource(), syncBytes); > } >@@ -231,8 +248,8 @@ > * @see Comparable#compareTo(Object) > */ > public int compareTo(Object arg0) { >- EclipseResource other = (EclipseResource)arg0; >- return resource.getFullPath().toString().compareTo(other.resource.getFullPath().toString()); >+ ICVSResource other = (ICVSResource)arg0; >+ return getLocation().toString().compareTo(other.getLocation().toString()); > } > > /** >@@ -272,4 +289,10 @@ > throw error[0]; > } > } >+ >+ public RepositoryProvider getProvider() { >+ if (resource != null && resource.getType() != IResource.ROOT) >+ return RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId()); >+ return null; >+ } > } >Index: src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java,v >retrieving revision 1.123 >diff -u -r1.123 EclipseSynchronizer.java >--- src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java 24 Jan 2011 11:53:55 -0000 1.123 >+++ src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java 1 Dec 2011 15:00:53 -0000 >@@ -137,6 +137,30 @@ > } > > /** >+ * Sets the folder sync info for the specified folder. >+ * The folder must exist and must not be the workspace root. >+ * >+ * @param folder the folder >+ * @param info the folder sync info, must not be null >+ * @see #getFolderSync, #deleteFolderSync >+ */ >+ public void setFolderSync(IPath folder, FolderSyncInfo info) throws CVSException { >+ Assert.isNotNull(info); // enforce the use of deleteFolderSync >+ // ignore folder sync on the root (i.e. CVSROOT/config/TopLevelAdmin=yes but we just ignore it) >+ if (folder.isRoot()) return; >+ if (!folder.toFile().exists()) { >+ // This means that the folder doesn't exist and is not a phantom >+ // Allow the set if the parent is a CVS folder since >+ // this can occur when creating phantom folders >+ if (getFolderSync(folder.removeLastSegments(1)) == null) { >+ IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE, >+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingFolderSync, new String[] { folder.toOSString() }),folder); >+ throw new CVSException(status); >+ } >+ } >+ SyncFileWriter.writeFolderSync(folder, info); >+ } >+ /** > * Gets the folder sync info for the specified folder. > * > * @param folder the folder >@@ -159,6 +183,21 @@ > } > > /** >+ * Gets the folder sync info for the specified folder. >+ * >+ * @param folder the folder >+ * @return the folder sync info associated with the folder, or null if none. >+ * @see #setFolderSync, #deleteFolderSync >+ */ >+ public FolderSyncInfo getFolderSync(IPath folder) throws CVSException { >+ if (folder.isRoot() || !folder.toFile().exists()) return null; >+ // Do a check outside the lock for any folder sync info >+ FolderSyncInfo info; >+ info = SyncFileWriter.readFolderSync(folder); >+ return info; >+ } >+ >+ /** > * Deletes the folder sync for the specified folder and the resource sync > * for all of its children. Does not recurse. > * >@@ -256,8 +295,27 @@ > * @return the resource sync info associated with the resource, or null if none. > * @see #setResourceSync, #deleteResourceSync > */ >+ public ResourceSyncInfo getResourceSync(IPath resource) throws CVSException { >+ byte[] info = getSyncBytes(resource); >+ if (info == null) return null; >+ return new ResourceSyncInfo(info); >+ } >+ >+ /** >+ * Gets the resource sync info for the specified folder. >+ * >+ * @param resource the resource >+ * @return the resource sync info associated with the resource, or null if none. >+ * @see #setResourceSync, #deleteResourceSync >+ */ > public byte[] getSyncBytes(IResource resource) throws CVSException { >+ if (resource.getLocation() == null) >+ return null; > IContainer parent = resource.getParent(); >+ if (shouldBeManagedOutsideOfTheWorkspace(resource, parent)) { >+ // this means the resource is linked, and the parent should be checked in the file system directly. >+ return getSyncBytes(resource.getLocation()); >+ } > if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) return null; > // Do a quick check outside the lock to see if there are sync butes for the resource. > byte[] info = getSyncInfoCacheFor(resource).getCachedSyncBytes(resource, false /* not thread safe */); >@@ -287,6 +345,24 @@ > } > > /** >+ * Gets the resource sync info for the specified folder that exist outside the workspace. >+ * >+ * @param path the resource >+ * @return the resource sync info associated with the resource, or null if none. >+ * @see #setResourceSync, #deleteResourceSync >+ */ >+ public byte[] getSyncBytes(IPath resource) throws CVSException { >+ IPath parent = resource.removeLastSegments(1); >+ if (parent == null || parent.isRoot() || !parent.toFile().exists()) return null; >+ // Do a quick check outside the lock to see if there are sync butes for the resource. >+ byte[] bytes = getSyncBytesFromDisk(resource); >+ if (!resource.toFile().exists() && bytes != null && !ResourceSyncInfo.isDeletion(bytes)) { >+ bytes = ResourceSyncInfo.convertToDeletion(bytes); >+ } >+ return bytes; >+ } >+ >+ /** > * Sets the resource sync info for the specified resource. > * The parent folder must exist and must not be the workspace root. > * >@@ -297,6 +373,12 @@ > public void setSyncBytes(IResource resource, byte[] syncBytes) throws CVSException { > Assert.isNotNull(syncBytes); // enforce the use of deleteResourceSync > IContainer parent = resource.getParent(); >+ if (shouldBeManagedOutsideOfTheWorkspace(resource, parent)) { >+ // this means the resource is linked, and the parent should be checked in the file system directly. >+ setSyncBytes(resource.getLocation(), syncBytes); >+ resourceChanged(resource); >+ return; >+ } > if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) { > IStatus status = new CVSStatus(IStatus.ERROR, TeamException.UNABLE, > NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.getFullPath().toString() }),resource); >@@ -320,6 +402,40 @@ > } > > /** >+ * Sets the resource sync info for the specified resource. >+ * The parent folder must exist and must not be the workspace root. >+ * >+ * @param resource the resource >+ * @param info the resource sync info, must not be null >+ * @see #getResourceSync, #deleteResourceSync >+ */ >+ public void setSyncBytes(IPath resource, byte[] syncBytes) throws CVSException { >+ Assert.isNotNull(syncBytes); // enforce the use of deleteResourceSync >+ IPath parent = resource.removeLastSegments(1); >+ if (parent == null || parent.isRoot() || !parent.toFile().exists()) { >+ IStatus status = new CVSStatus(IStatus.ERROR, >+ NLS.bind(CVSMessages.EclipseSynchronizer_ErrorSettingResourceSync, new String[] { resource.toOSString() })); >+ throw new CVSException(status); >+ } >+ byte[][] infos = SyncFileWriter.readAllResourceSync(parent); >+ if (infos == null) return; >+ boolean added = false; >+ for (int i = 0; i < infos.length; i++) { >+ byte[] bytes = infos[i]; >+ if (resource.lastSegment().equals(getName(bytes))) { >+ infos[i] = syncBytes; >+ added = true; >+ } >+ } >+ if (!added) { >+ ArrayList list = new ArrayList(Arrays.asList(infos)); >+ list.add(syncBytes); >+ infos = (byte[][]) list.toArray(new byte[0][]); >+ } >+ SyncFileWriter.writeAllResourceSync(parent, infos); >+ } >+ >+ /** > * Deletes the resource sync info for the specified resource, if it exists. > * > * @param resource the resource >@@ -327,6 +443,11 @@ > */ > public void deleteResourceSync(IResource resource) throws CVSException { > IContainer parent = resource.getParent(); >+ if (shouldBeManagedOutsideOfTheWorkspace(resource, parent)) { >+ // this means the resource is linked, and the parent should be checked in the file system directly. >+ deleteResourceSync(resource.getLocation()); >+ return; >+ } > if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) return; > ISchedulingRule rule = null; > try { >@@ -348,6 +469,33 @@ > } > } > >+ private boolean shouldBeManagedOutsideOfTheWorkspace(IResource resource, >+ IContainer parent) { >+ // parent.getLocation() can be null >+ return (parent != null) && (resource.getType() != IResource.PROJECT) && !resource.getLocation().removeLastSegments(1).equals(parent.getLocation()); >+ } >+ >+ /** >+ * Deletes the resource sync info for the specified resource, if it exists. >+ * >+ * @param resource the resource >+ * @see #getResourceSync, #setResourceSync >+ */ >+ public void deleteResourceSync(IPath resource) throws CVSException { >+ IPath parent = resource.removeLastSegments(1); >+ if (parent == null || parent.isRoot() || !parent.toFile().exists()) return; >+ ArrayList newInfos = new ArrayList(); >+ byte[][] infos = SyncFileWriter.readAllResourceSync(parent); >+ if (infos == null) return; >+ for (int i = 0; i < infos.length; i++) { >+ byte[] bytes = infos[i]; >+ if (!resource.lastSegment().equals(getName(bytes))) { >+ newInfos.add(infos[i]); >+ } >+ } >+ SyncFileWriter.writeAllResourceSync(parent, (byte[][]) newInfos.toArray(new byte[0][])); >+ } >+ > /** > * @param resource > */ >@@ -860,12 +1008,7 @@ > if (! getSyncInfoCacheFor(container).isResourceSyncInfoCached(container)) { > // load the sync info from disk > byte[][] infos; >- // do not load the sync info for resources that are linked >- if (isLinkedResource(container)) { >- infos = null; >- } else { > infos = SyncFileWriter.readAllResourceSync(container); >- } > try { > if (infos != null) { > for (int i = 0; i < infos.length; i++) { >@@ -901,20 +1044,16 @@ > if (! getSyncInfoCacheFor(container).isFolderSyncInfoCached(container)) { > // load the sync info from disk > FolderSyncInfo info; >- // do not load the sync info for resources that are linked >- if (isLinkedResource(container)) { >- info = null; >- } else { > info = SyncFileWriter.readFolderSync(container); >- } >+ > getSyncInfoCacheFor(container).setCachedFolderSync(container, info, false); > } > } > >- private boolean isLinkedResource(IResource resource) { >+/* private boolean isLinkedResource(IResource resource) { > return CVSWorkspaceRoot.isLinkedResource(resource); > } >- >+*/ > /** > * Load the sync info for the given resource from disk > * @param resource >@@ -933,6 +1072,23 @@ > } > > /** >+ * Load the sync info for the given resource from disk >+ * @param resource >+ * @return byte[] >+ */ >+ private byte[] getSyncBytesFromDisk(IPath resource) throws CVSException { >+ byte[][] infos = SyncFileWriter.readAllResourceSync(resource.removeLastSegments(1)); >+ if (infos == null) return null; >+ for (int i = 0; i < infos.length; i++) { >+ byte[] syncBytes = infos[i]; >+ if (resource.lastSegment().equals(getName(syncBytes))) { >+ return syncBytes; >+ } >+ } >+ return null; >+ } >+ >+ /** > * Commits the cache after a series of operations. > * > * Will return STATUS_OK unless there were problems writting sync >@@ -961,8 +1117,10 @@ > for (int i = 0; i < changedResources.length; i++) { > IResource resource = changedResources[i]; > IContainer folder = resource.getParent(); >+ if (!shouldBeManagedOutsideOfTheWorkspace(resource, folder)) { > dirtyParents.add(folder); > } >+ } > > monitor = Policy.monitorFor(monitor); > int numDirty = dirtyParents.size(); >@@ -986,7 +1144,6 @@ > if (info == null) { > // deleted folder sync info since we loaded it > // (but don't overwrite the sync info for linked folders >- if (!isLinkedResource(folder)) > SyncFileWriter.deleteFolderSync(folder); > dirtyParents.remove(folder); > } else { >@@ -1026,8 +1183,7 @@ > infos.add(syncBytes); > } > } >- // do not overwrite the sync info for linked resources >- if (infos.size() > 0 || !isLinkedResource(folder)) >+ if (infos.size() > 0) > SyncFileWriter.writeAllResourceSync(folder, > (byte[][]) infos.toArray(new byte[infos.size()][])); > } catch(CVSException e) { >@@ -1198,9 +1354,36 @@ > */ > public void setNotifyInfo(IResource resource, NotifyInfo info) throws CVSException { > NotifyInfo[] infos = SyncFileWriter.readAllNotifyInfo(resource.getParent()); >+ infos = setNotifyInfo(resource.getName(), info, infos); >+ if (infos != null) >+ SyncFileWriter.writeAllNotifyInfo(resource.getParent(), infos); >+ } >+ >+ /** >+ * Add the entry to the CVS/Notify file. We are not initially concerned with efficiency >+ * since edit/unedit are typically issued on a small set of files. >+ * >+ * XXX If there was a previous notify entry for the resource, it is replaced. This is >+ * probably not the proper behavior (see EclipseFile). >+ * >+ * A value of null for info indicates that any entry for the given >+ * resource is to be removed from the Notify file. >+ * >+ * @param resource >+ * @param info >+ */ >+ public void setNotifyInfo(IPath resource, NotifyInfo info) throws CVSException { >+ NotifyInfo[] infos = SyncFileWriter.readAllNotifyInfo(resource.removeLastSegments(1)); >+ infos = setNotifyInfo(resource.lastSegment(), info, infos); >+ if (infos != null) >+ SyncFileWriter.writeAllNotifyInfo(resource.removeLastSegments(1), infos); >+ } >+ >+ private NotifyInfo[] setNotifyInfo(String name, NotifyInfo info, >+ NotifyInfo[] infos) { > if (infos == null) { > // if the file is empty and we are removing an entry, just return; >- if (info == null) return; >+ if (info == null) return null; > infos = new NotifyInfo[] { info }; > } else { > Map infoMap = new HashMap(); >@@ -1210,7 +1393,7 @@ > } > if (info == null) { > // if the info is null, remove the entry >- infoMap.remove(resource.getName()); >+ infoMap.remove(name); > } else { > // add the new entry to the list > infoMap.put(info.getName(), info); >@@ -1223,7 +1406,7 @@ > } > infos = newInfos; > } >- SyncFileWriter.writeAllNotifyInfo(resource.getParent(), infos); >+ return infos; > } > > /** >@@ -1244,6 +1427,23 @@ > } > > /** >+ * Method getNotifyInfo. >+ * @param resource >+ * @return NotifyInfo >+ */ >+ public NotifyInfo getNotifyInfo(IPath resource) throws CVSException { >+ NotifyInfo[] infos = SyncFileWriter.readAllNotifyInfo(resource.removeLastSegments(1)); >+ if (infos == null) return null; >+ for (int i = 0; i < infos.length; i++) { >+ NotifyInfo notifyInfo = infos[i]; >+ if (notifyInfo.getName().equals(resource.lastSegment())) { >+ return notifyInfo; >+ } >+ } >+ return null; >+ } >+ >+ /** > * Method deleteNotifyInfo. > * @param resource > */ >@@ -1265,6 +1465,27 @@ > } > > /** >+ * Method deleteNotifyInfo. >+ * @param resource >+ */ >+ public void deleteNotifyInfo(IPath resource) throws CVSException { >+ NotifyInfo[] infos = SyncFileWriter.readAllNotifyInfo(resource.removeLastSegments(1)); >+ if (infos == null) return; >+ Map infoMap = new HashMap(); >+ for (int i = 0; i < infos.length; i++) { >+ NotifyInfo notifyInfo = infos[i]; >+ infoMap.put(notifyInfo.getName(), notifyInfo); >+ } >+ infoMap.remove(resource.lastSegment()); >+ NotifyInfo[] newInfos = new NotifyInfo[infoMap.size()]; >+ int i = 0; >+ for (Iterator iter = infoMap.values().iterator(); iter.hasNext();) { >+ newInfos[i++] = (NotifyInfo) iter.next(); >+ } >+ SyncFileWriter.writeAllNotifyInfo(resource.removeLastSegments(1), newInfos); >+ } >+ >+ /** > * Add the entry to the CVS/Baserev file. We are not initially concerned > * with efficiency since edit/unedit are typically issued on a small set of > * files. >@@ -1277,6 +1498,28 @@ > */ > public void setBaserevInfo(IResource resource, BaserevInfo info) throws CVSException { > BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.getParent()); >+ infos = setBaserevInfo(info, infos); >+ SyncFileWriter.writeAllBaserevInfo(resource.getParent(), infos); >+ } >+ >+ /** >+ * Add the entry to the CVS/Baserev file. We are not initially concerned >+ * with efficiency since edit/unedit are typically issued on a small set of >+ * files. >+ * >+ * XXX If there was a previous notify entry for the resource, it is replaced. This is >+ * probably not the proper behavior (see EclipseFile). >+ * >+ * @param resource >+ * @param info >+ */ >+ public void setBaserevInfo(IPath resource, BaserevInfo info) throws CVSException { >+ BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.removeLastSegments(1)); >+ infos = setBaserevInfo(info, infos); >+ SyncFileWriter.writeAllBaserevInfo(resource.removeLastSegments(1), infos); >+ } >+ >+ private BaserevInfo[] setBaserevInfo(BaserevInfo info, BaserevInfo[] infos) { > if (infos == null) { > infos = new BaserevInfo[] { info }; > } else { >@@ -1292,7 +1535,7 @@ > } > infos = newInfos; > } >- SyncFileWriter.writeAllBaserevInfo(resource.getParent(), infos); >+ return infos; > } > > /** >@@ -1303,9 +1546,24 @@ > public BaserevInfo getBaserevInfo(IResource resource) throws CVSException { > BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.getParent()); > if (infos == null) return null; >+ return getBaserevInfo(resource.getName(), infos); >+ } >+ >+ /** >+ * Method getBaserevInfo. >+ * @param resource >+ * @return BaserevInfo >+ */ >+ public BaserevInfo getBaserevInfo(IPath resource) throws CVSException { >+ BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.removeLastSegments(1)); >+ if (infos == null) return null; >+ return getBaserevInfo(resource.lastSegment(), infos); >+ } >+ >+ private BaserevInfo getBaserevInfo(String name, BaserevInfo[] infos) { > for (int i = 0; i < infos.length; i++) { > BaserevInfo info = infos[i]; >- if (info.getName().equals(resource.getName())) { >+ if (info.getName().equals(name)) { > return info; > } > } >@@ -1319,17 +1577,34 @@ > public void deleteBaserevInfo(IResource resource) throws CVSException { > BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.getParent()); > if (infos == null) return; >+ BaserevInfo[] newInfos = deleteBaserevInfo(resource.getName(), infos); >+ SyncFileWriter.writeAllBaserevInfo(resource.getParent(), newInfos); >+ } >+ >+ /** >+ * Method deleteNotifyInfo. >+ * @param resource >+ */ >+ public void deleteBaserevInfo(IPath resource) throws CVSException { >+ BaserevInfo[] infos = SyncFileWriter.readAllBaserevInfo(resource.removeLastSegments(1)); >+ if (infos == null) return; >+ BaserevInfo[] newInfos = deleteBaserevInfo(resource.lastSegment(), infos); >+ SyncFileWriter.writeAllBaserevInfo(resource.removeLastSegments(1), newInfos); >+ } >+ >+ private BaserevInfo[] deleteBaserevInfo(String name, >+ BaserevInfo[] infos) { > Map infoMap = new HashMap(); > for (int i = 0; i < infos.length; i++) { > infoMap.put(infos[i].getName(), infos[i]); > } >- infoMap.remove(resource.getName()); >+ infoMap.remove(name); > BaserevInfo[] newInfos = new BaserevInfo[infoMap.size()]; > int i = 0; > for (Iterator iter = infoMap.values().iterator(); iter.hasNext();) { > newInfos[i++] = (BaserevInfo) iter.next(); > } >- SyncFileWriter.writeAllBaserevInfo(resource.getParent(), newInfos); >+ return newInfos; > } > > public void copyFileToBaseDirectory(final IFile file, IProgressMonitor monitor) throws CVSException { >@@ -1350,6 +1625,20 @@ > } > } > >+ public void copyFileToBaseDirectory(final IPath file, IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ try { >+ ResourceSyncInfo info = getResourceSync(file); >+ // The file must exist remotely and locally >+ if (info == null || info.isAdded() || info.isDeleted()) >+ return; >+ SyncFileWriter.writeFileToBaseDirectory(file, Policy.subMonitorFor(monitor, 80)); >+ } finally { >+ monitor.done(); >+ } >+ } >+ > public void restoreFileFromBaseDirectory(final IFile file, IProgressMonitor monitor) throws CVSException { > monitor = Policy.monitorFor(monitor); > monitor.beginTask(null, 100); >@@ -1368,6 +1657,20 @@ > } > } > >+ public void restoreFileFromBaseDirectory(final IPath file, IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ try { >+ ResourceSyncInfo info = getResourceSync(file); >+ // The file must exist remotely >+ if (info == null || info.isAdded()) >+ return; >+ SyncFileWriter.restoreFileFromBaseDirectory(file, Policy.subMonitorFor(monitor, 80)); >+ } finally { >+ monitor.done(); >+ } >+ } >+ > public void deleteFileFromBaseDirectory(final IFile file, IProgressMonitor monitor) throws CVSException { > ResourceSyncInfo info = getResourceSync(file); > // The file must exist remotely >@@ -1376,6 +1679,14 @@ > SyncFileWriter.deleteFileFromBaseDirectory(file, monitor); > } > >+ public void deleteFileFromBaseDirectory(final IPath file, IProgressMonitor monitor) throws CVSException { >+ ResourceSyncInfo info = getResourceSync(file); >+ // The file must exist remotely >+ if (info == null || info.isAdded()) >+ return; >+ SyncFileWriter.deleteFileFromBaseDirectory(file, monitor); >+ } >+ > /** > * Method isSyncInfoLoaded returns true if all the sync info for the > * provided resources is loaded into the internal cache. >@@ -1488,6 +1799,16 @@ > return SyncFileWriter.isEdited(resource); > } > >+ /** >+ * Method isEdited returns true if a "cvs edit" was performed on the given >+ * file and no commit or unedit has yet been performed. >+ * @param iResource >+ * @return boolean >+ */ >+ public boolean isEdited(IPath resource) { >+ return SyncFileWriter.isEdited(resource); >+ } >+ > /* package */ void adjustDirtyStateRecursively(IResource resource, String indicator) throws CVSException { > if (resource.getType() == IResource.ROOT) return; > try { >Index: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFile.java >=================================================================== >RCS file: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFile.java >diff -N src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFile.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFile.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,595 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * Red Hat Incorporated - is/setExecutable() code >+ *******************************************************************************/ >+package org.eclipse.team.internal.ccvs.core.resources; >+ >+import java.io.*; >+import java.util.*; >+ >+import org.eclipse.core.filesystem.*; >+import org.eclipse.core.filesystem.URIUtil; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.*; >+import org.eclipse.team.core.RepositoryProvider; >+import org.eclipse.team.core.TeamException; >+import org.eclipse.team.internal.ccvs.core.*; >+import org.eclipse.team.internal.ccvs.core.client.Session; >+import org.eclipse.team.internal.ccvs.core.syncinfo.*; >+ >+/** >+ * Represents handles to CVS resource on the local file system. Synchronization >+ * information is taken from the CVS sub directories. >+ */ >+public class FileSystemFile extends FileSystemResource implements ICVSFile { >+ >+ private static final IPath PROJECT_META_DATA_PATH = new Path(".project");//$NON-NLS-1$ >+ >+ /** >+ * Create a handle based on the given local resource. >+ */ >+ protected FileSystemFile(IPath resource, >+ RepositoryProvider repositoryProvider) { >+ super(resource, repositoryProvider); >+ } >+ >+ /* >+ * @see ICVSResource#delete() >+ */ >+ public void delete() throws CVSException { >+ resource.toFile().delete(); >+ } >+ >+ public long getSize() { >+ return getIOFile().length(); >+ } >+ >+ public InputStream getContents() throws CVSException { >+ try { >+ return new FileInputStream(resource.toFile()); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); // >+ } >+ } >+ >+ /* >+ * @see ICVSFile#getTimeStamp() >+ */ >+ public Date getTimeStamp() { >+ long timestamp = getFileInfo().getLastModified(); >+ if( timestamp == IResource.NULL_STAMP) { >+ // If there is no file, return the same timestamp as ioFile.lastModified() would >+ return new Date(0L); >+ } >+ return new Date((timestamp/1000)*1000); >+ } >+ >+ private IFileInfo getFileInfo() { >+ try { >+ return EFS.getStore(URIUtil.toURI(resource)).fetchInfo(); >+ } catch (CoreException e) { >+ return EFS.createFileInfo(); >+ } >+ } >+ >+ /* >+ * @see ICVSFile#setTimeStamp(Date) >+ */ >+ public void setTimeStamp(Date date) throws CVSException { >+ long time; >+ if (date == null) { >+ time = System.currentTimeMillis(); >+ } else { >+ time = date.getTime(); >+ } >+ getFileInfo().setLastModified(time); >+ } >+ >+ /* >+ * @see ICVSFile#isModified() >+ */ >+ public boolean isModified(IProgressMonitor monitor) throws CVSException { >+ >+ // ignore the monitor, there is no valuable progress to be shown when >+ // calculating the dirty state for files. It is relatively fast. >+ >+ if (!exists()) { >+ return getSyncBytes() != null; >+ } >+ return true; >+ } >+ >+ /* >+ * @see ICVSResource#accept(ICVSResourceVisitor) >+ */ >+ public void accept(ICVSResourceVisitor visitor) throws CVSException { >+ visitor.visitFile(this); >+ } >+ >+ /* >+ * @see ICVSResource#accept(ICVSResourceVisitor, boolean) >+ */ >+ public void accept(ICVSResourceVisitor visitor, boolean recurse) throws CVSException { >+ visitor.visitFile(this); >+ } >+ >+ /* >+ * This is to be used by the Copy handler. The filename of the form .#filename >+ */ >+ public void copyTo(String filename) throws CVSException { >+ try { >+ InputStream in = new FileInputStream(resource.toFile()); >+ File targetFile = resource.removeLastSegments(1).append(filename).toFile(); >+ if (targetFile.exists()) >+ targetFile.delete(); >+ OutputStream out = new FileOutputStream(targetFile); >+ >+ // Transfer bytes from in to out >+ byte[] buf = new byte[1024]; >+ int len; >+ while ((len = in.read(buf)) > 0) { >+ out.write(buf, 0, len); >+ } >+ in.close(); >+ out.close(); >+ } catch(IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ /* >+ * @see ICVSResource#getRemoteLocation() >+ */ >+ public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException { >+ return getParent().getRemoteLocation(stopSearching) + SEPARATOR + getName(); >+ } >+ >+ /* >+ * @see ICVSFile#setReadOnly() >+ */ >+ public void setContents(InputStream stream, int responseType, boolean keepLocalHistory, IProgressMonitor monitor) throws CVSException { >+ try { >+ if (PROJECT_META_DATA_PATH.equals(resource.lastSegment())) { >+ responseType = UPDATED; >+ } >+ ByteArrayOutputStream os = new ByteArrayOutputStream(); >+ int nextByte; >+ while ((nextByte = stream.read() ) != -1) { >+ os.write((byte) nextByte); >+ } >+ switch (responseType) { >+ case UPDATED: >+ if (exists()) { >+ writefile(os); >+ break; >+ } >+ case CREATED: // creating a new file so it should not exist locally >+ case MERGED: // merging contents into a file that exists locally >+ case UPDATE_EXISTING: // creating a new file so it should exist locally >+ writefile(os); >+ break; >+ } >+ } catch(IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ private void writefile(ByteArrayOutputStream os) >+ throws FileNotFoundException, IOException { >+ RandomAccessFile raFile = new RandomAccessFile(getIOFile(), "rw"); //$NON-NLS-1$ >+ raFile.write(os.toByteArray()); >+ raFile.setLength(os.toByteArray().length); >+ raFile.close(); >+ } >+ >+ /* >+ * @see ICVSFile#setReadOnly() >+ */ >+ public void setReadOnly(boolean readOnly) throws CVSException { >+ try { >+ IFileStore fileStore = EFS.getStore(URIUtil.toURI(resource)); >+ if (fileStore != null) { >+ IFileInfo fileInfo = fileStore.fetchInfo(); >+ if (fileInfo != null) >+ fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, readOnly); >+ } >+ } catch (CoreException e) { >+ CVSException.wrapException(e); >+ } >+ } >+ >+ /* >+ * @see ICVSFile#isReadOnly() >+ */ >+ public boolean isReadOnly() throws CVSException { >+ return !getIOFile().canWrite(); >+ } >+ >+ /* >+ * @see ICVSFile#setExecutable() >+ */ >+ public void setExecutable(boolean executable) throws CVSException { >+ try { >+ IFileStore fileStore = EFS.getStore(URIUtil.toURI(resource)); >+ if (fileStore != null) { >+ IFileInfo fileInfo = fileStore.fetchInfo(); >+ if (fileInfo != null) >+ fileInfo.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, executable); >+ } >+ } catch (CoreException e) { >+ CVSException.wrapException(e); >+ } >+ } >+ >+ /* >+ * @see ICVSFile#isExectuable() >+ */ >+ public boolean isExecutable() throws CVSException { >+ try { >+ IFileStore fileStore = EFS.getStore(URIUtil.toURI(resource)); >+ if (fileStore != null) { >+ IFileInfo fileInfo = fileStore.fetchInfo(); >+ if (fileInfo != null) >+ return fileInfo.getAttribute(EFS.ATTRIBUTE_EXECUTABLE); >+ } >+ } catch (CoreException e) { >+ CVSException.wrapException(e); >+ } >+ return false; >+ } >+ >+ /* >+ * To allow accessing size and timestamp for the underlying java.io.File >+ */ >+ private File getIOFile() { >+ return resource.toFile(); >+ } >+ /** >+ * @see ICVSFile#getLogEntries(IProgressMonitor) >+ */ >+ public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws TeamException { >+ byte[] syncBytes = getSyncBytes(); >+ if(syncBytes != null && !ResourceSyncInfo.isAddition(syncBytes)) { >+ ICVSRemoteResource remoteFile = CVSWorkspaceRoot.getRemoteResourceFor(this); >+ if (remoteFile != null) >+ return ((ICVSRemoteFile)remoteFile).getLogEntries(monitor); >+ } >+ return new ILogEntry[0]; >+ } >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#setNotifyInfo(NotifyInfo) >+ */ >+ public void setNotifyInfo(NotifyInfo info) throws CVSException { >+ if (isManaged()) { >+ EclipseSynchronizer.getInstance().setNotifyInfo(resource, info); >+ // On an edit, the base should be cached >+ // On an unedit, the base should be restored (and cleared?) >+ // On a commit, the base should be cleared >+ } >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#getNotifyInfo() >+ */ >+ public NotifyInfo getNotifyInfo() throws CVSException { >+ if (isManaged()) { >+ return EclipseSynchronizer.getInstance().getNotifyInfo(resource); >+ } >+ return null; >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#setNotifyInfo(NotifyInfo) >+ */ >+ public void setBaserevInfo(BaserevInfo info) throws CVSException { >+ if (isManaged()) { >+ if (info == null) { >+ EclipseSynchronizer.getInstance().deleteBaserevInfo(resource); >+ EclipseSynchronizer.getInstance().deleteFileFromBaseDirectory(resource, null); >+ } else >+ EclipseSynchronizer.getInstance().setBaserevInfo(resource, info); >+ } >+ } >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#getNotifyInfo() >+ */ >+ public BaserevInfo getBaserevInfo() throws CVSException { >+ if (isManaged()) { >+ return EclipseSynchronizer.getInstance().getBaserevInfo(resource); >+ } >+ return null; >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#checkout(int) >+ */ >+ public void edit(final int notifications, boolean notifyForWritable, IProgressMonitor monitor) throws CVSException { >+ if (!notifyForWritable && !isReadOnly()) return; >+ run(new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) throws CVSException { >+ byte[] syncBytes = getSyncBytes(); >+ if (syncBytes == null || ResourceSyncInfo.isAddition(syncBytes)) return; >+ >+ // convert the notifications to internal form >+ char[] internalFormat; >+ if (notifications == NO_NOTIFICATION) { >+ internalFormat = null; >+ } else if (notifications == NOTIFY_ON_ALL) { >+ internalFormat = NotifyInfo.ALL; >+ } else { >+ List notificationCharacters = new ArrayList(); >+ if ((notifications & NOTIFY_ON_EDIT) >0) >+ notificationCharacters.add(new Character(NotifyInfo.EDIT)); >+ if ((notifications & NOTIFY_ON_UNEDIT) >0) >+ notificationCharacters.add(new Character(NotifyInfo.UNEDIT)); >+ if ((notifications & NOTIFY_ON_COMMIT) >0) >+ notificationCharacters.add(new Character(NotifyInfo.COMMIT)); >+ internalFormat = new char[notificationCharacters.size()]; >+ for (int i = 0; i < internalFormat.length; i++) { >+ internalFormat[i] = ((Character)notificationCharacters.get(i)).charValue(); >+ } >+ } >+ >+ // record the notification >+ NotifyInfo notifyInfo = new NotifyInfo(getName(), NotifyInfo.EDIT, new Date(), internalFormat); >+ setNotifyInfo(notifyInfo); >+ >+ // Only record the base if the file is not modified >+ if (!isModified(null)) { >+ EclipseSynchronizer.getInstance().copyFileToBaseDirectory(resource, monitor); >+ setBaserevInfo(new BaserevInfo(getName(), ResourceSyncInfo.getRevision(syncBytes))); >+ } >+ >+ try { >+ // allow editing >+ setReadOnly(false); >+ } catch (CVSException e) { >+ // Just log and keep going >+ CVSProviderPlugin.log(e); >+ } >+ } >+ }, monitor); >+ >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#uncheckout() >+ */ >+ public void unedit(IProgressMonitor monitor) throws CVSException { >+ if (isReadOnly()) return; >+ run(new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) throws CVSException { >+ // record the notification >+ NotifyInfo info = getNotifyInfo(); >+ if (info != null && info.getNotificationType() == NotifyInfo.EDIT) { >+ info = null; >+ } else { >+ info = new NotifyInfo(getName(), NotifyInfo.UNEDIT, new Date(), null); >+ } >+ setNotifyInfo(info); >+ >+ if (isModified(null)) { >+ ResourceSyncInfo syncInfo = getSyncInfo(); >+ BaserevInfo baserevInfo = getBaserevInfo(); >+ EclipseSynchronizer.getInstance().restoreFileFromBaseDirectory(resource, monitor); >+ // reset any changes that may have been merged from the server >+ if (!syncInfo.getRevision().equals(baserevInfo.getRevision())) { >+ MutableResourceSyncInfo newInfo = syncInfo.cloneMutable(); >+ newInfo.setRevision(baserevInfo.getRevision()); >+ newInfo.setTimeStamp(getTimeStamp()); >+ newInfo.setDeleted(false); >+ setSyncInfo(newInfo, ICVSFile.CLEAN); >+ } else { >+ // an unedited file is no longer modified >+ // external files have no modified states >+ //EclipseSynchronizer.getInstance().setModified(resource, CLEAN); >+ } >+ } else { >+ // We still need to report a state change >+ setSyncBytes(getSyncBytes(), ICVSFile.CLEAN); >+ } >+ setBaserevInfo(null); >+ >+ try { >+ // prevent editing >+ setReadOnly(true); >+ } catch (CVSException e) { >+ // Just log and keep going >+ CVSProviderPlugin.log(e); >+ } >+ } >+ }, monitor); >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#notificationCompleted() >+ */ >+ public void notificationCompleted() throws CVSException { >+ EclipseSynchronizer.getInstance().deleteNotifyInfo(resource); >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#getPendingNotification() >+ */ >+ public NotifyInfo getPendingNotification() throws CVSException { >+ return getNotifyInfo(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#checkedIn(java.lang.String) >+ */ >+ public void checkedIn(String entryLine, boolean commit) throws CVSException { >+ ResourceSyncInfo oldInfo = getSyncInfo(); >+ ResourceSyncInfo newInfo = null; >+ int modificationState = ICVSFile.CLEAN; >+ if (entryLine == null) { >+ // cvs commit: the file contents matched the server contents so no entry line was sent >+ if (oldInfo == null) return; >+ // We should never make the timestamp go backwards so we'll set >+ // the entry line timestamp to match that of the file >+ if(! oldInfo.isAdded()) { >+ MutableResourceSyncInfo mutable = oldInfo.cloneMutable(); >+ mutable.setTimeStamp(getTimeStamp(), true /* clear merged */); >+ newInfo = mutable; >+ } >+ // (modified = false) the file will be no longer modified >+ } else if (oldInfo == null) { >+ // cvs add: addition of a file >+ newInfo = new ResourceSyncInfo(entryLine, null); >+ // an added file should show up as modified >+ modificationState = ICVSFile.DIRTY; >+ } else { >+ // cvs commit: commit of a changed file >+ // cvs update: update of a file whose contents match the server contents >+ Date timeStamp; >+ if (commit) { >+ // This is a commit. Put the file timestamp in the entry >+ timeStamp = getTimeStamp(); >+ } else { >+ // This is an update. We need to change the tiemstamp in the >+ // entry file to match the file timestamp returned by Java >+ timeStamp = oldInfo.getTimeStamp(); >+ if (timeStamp == null) { >+ timeStamp = getTimeStamp(); >+ } else { >+ // First, set the timestamp of the file to the timestamp from the entry >+ // There is a chance this will do nothing as the call to Java on some >+ // file systems munges the timestamps >+ setTimeStamp(timeStamp); >+ // To compensate for the above, reset the timestamp in the entry >+ // to match the timestamp in the file >+ timeStamp = getTimeStamp(); >+ } >+ } >+ newInfo = new ResourceSyncInfo(entryLine, timeStamp); >+ >+ } >+ //see bug 106876 >+ if (newInfo != null){ >+ CVSTag tag = newInfo.getTag(); >+ if(tag != null && CVSEntryLineTag.BASE.getName().equals(tag.getName())){ >+ newInfo = newInfo.cloneMutable(); >+ ((MutableResourceSyncInfo)newInfo).setTag(oldInfo.getTag()); >+ } >+ setSyncInfo(newInfo, modificationState); >+ } >+ clearCachedBase(); >+ } >+ >+ private void clearCachedBase() throws CVSException { >+ BaserevInfo base = getBaserevInfo(); >+ if (base != null) { >+ setBaserevInfo(null); >+ try { >+ setReadOnly(true); >+ } catch (CVSException e) { >+ // Just log and keep going >+ CVSProviderPlugin.log(e); >+ } >+ } else { >+ // Check to see if watch-edit is enabled for the project >+ if (repositoryProvider != null && ((CVSTeamProvider) repositoryProvider).isWatchEditEnabled()) { >+ try { >+ setReadOnly(true); >+ } catch (CVSException e) { >+ // Just log and keep going >+ CVSProviderPlugin.log(e); >+ } >+ } >+ } >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#unmanage(org.eclipse.core.runtime.IProgressMonitor) >+ */ >+ public void unmanage(IProgressMonitor monitor) throws CVSException { >+ run(new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) throws CVSException { >+ FileSystemFile.super.unmanage(monitor); >+ clearCachedBase(); >+ } >+ }, monitor); >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#isEdited() >+ */ >+ public boolean isEdited() throws CVSException { >+ return EclipseSynchronizer.getInstance().isEdited(resource); >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#setSyncInfo(org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo) >+ */ >+ public void setSyncInfo(ResourceSyncInfo info, int modificationState) throws CVSException { >+ setSyncBytes(info.getBytes(), info, modificationState); >+ } >+ >+ /** >+ * @see ICVSResource#isFolder() >+ */ >+ public boolean isFolder() { >+ return false; >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.resources.EclipseResource#setSyncBytes(byte[], int) >+ */ >+ public void setSyncBytes(byte[] syncBytes, int modificationState) throws CVSException { >+ setSyncBytes(syncBytes, null, modificationState); >+ } >+ >+ /* >+ * @see org.eclipse.team.internal.ccvs.core.resources.EclipseResource#setSyncBytes(byte[], int) >+ */ >+ private void setSyncBytes(byte[] syncBytes, ResourceSyncInfo info, int modificationState) throws CVSException { >+ Assert.isNotNull(syncBytes); >+ setSyncBytes(syncBytes); >+ // external files have no modified states >+ //EclipseSynchronizer.getInstance().setModified(this, modificationState); >+ } >+ >+ public void handleModification(boolean forAddition) throws CVSException { >+ // external files have no modified states >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#getRepositoryRelativePath() >+ */ >+ public String getRepositoryRelativePath() throws CVSException { >+ if (!isManaged()) return null; >+ String parentPath = getParent().getRepositoryRelativePath(); >+ if (parentPath == null) return null; >+ return parentPath + Session.SERVER_SEPARATOR + getName(); >+ } >+ >+ protected boolean isDirty() throws CVSException { >+ boolean dirty; >+ byte[] syncBytes = getSyncBytes(); >+ if (syncBytes == null) { >+ dirty = exists(); >+ } else { >+ // isMerged() must be called because when a file is updated and merged by the cvs server the timestamps >+ // are equal. Merged files should however be reported as dirty because the user should take action and commit >+ // or review the merged contents. >+ if(ResourceSyncInfo.isAddition(syncBytes) || ResourceSyncInfo.isMerge(syncBytes) || !exists()) { >+ dirty = true; >+ } else { >+ // TODO: non-optimal as ResourceSyncInfo is created each time >+ ResourceSyncInfo info = new ResourceSyncInfo(syncBytes); >+ dirty = !getTimeStamp().equals(info.getTimeStamp()); >+ } >+ } >+ return dirty; >+ } >+ >+} >+ >+ >Index: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFolder.java >=================================================================== >RCS file: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFolder.java >diff -N src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFolder.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/internal/ccvs/core/resources/FileSystemFolder.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,363 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.internal.ccvs.core.resources; >+ >+import java.io.File; >+import java.util.ArrayList; >+import java.util.List; >+ >+import org.eclipse.core.filesystem.*; >+import org.eclipse.core.filesystem.URIUtil; >+import org.eclipse.core.resources.*; >+import org.eclipse.core.runtime.*; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.team.core.RepositoryProvider; >+import org.eclipse.team.internal.ccvs.core.*; >+import org.eclipse.team.internal.ccvs.core.client.Session; >+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; >+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; >+import org.eclipse.team.internal.ccvs.core.util.Util; >+ >+/** >+ * Implements the ICVSFolder interface on top of an >+ * instance of the ICVSFolder interface >+ * >+ * @see ICVSFolder >+ */ >+class FileSystemFolder extends FileSystemResource implements ICVSFolder { >+ >+ protected FileSystemFolder(IPath resource, RepositoryProvider repositoryProvider) { >+ super(resource, repositoryProvider); >+ } >+ >+ /** >+ * @see ICVSFolder#members(int) >+ */ >+ public ICVSResource[] members(int flags) throws CVSException { >+ final List result = new ArrayList(); >+ File resources[] = resource.toFile().listFiles(); >+ boolean includeFiles = (((flags & FILE_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); >+ boolean includeFolders = (((flags & FOLDER_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); >+ boolean includeManaged = (((flags & MANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); >+ boolean includeUnmanaged = (((flags & UNMANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); >+ boolean includeIgnored = ((flags & IGNORED_MEMBERS) != 0); >+ boolean includeExisting = (((flags & EXISTING_MEMBERS) != 0) || ((flags & (EXISTING_MEMBERS | PHANTOM_MEMBERS)) == 0)); >+ boolean includePhantoms = (((flags & PHANTOM_MEMBERS) != 0) || ((flags & (EXISTING_MEMBERS | PHANTOM_MEMBERS)) == 0)); >+ for (int i = 0; i < resources.length; i++) { >+ File resource = resources[i]; >+ if ((includeFiles && resource.isFile()) >+ || (includeFolders && resource.isDirectory())) { >+ boolean exists = resource.exists(); >+ if ((includeExisting && exists) || (includePhantoms && !exists)) { >+ ICVSResource cvsResource = CVSFileSystemRoot.getCVSResourceFor(new Path(resource.getAbsolutePath()), repositoryProvider); >+ boolean includeResource = false; >+ if ((includeManaged && includeUnmanaged && includeIgnored)) { >+ includeResource = true; >+ } else { >+ boolean isManaged = cvsResource.isManaged(); >+ if (isManaged && includeManaged) { >+ includeResource = true; >+ } else if (exists) { >+ boolean isIgnored = cvsResource.isIgnored(); >+ if (isIgnored && includeIgnored) { >+ includeResource = true; >+ } else if (! isManaged && ! isIgnored && includeUnmanaged) { >+ includeResource = true; >+ } >+ } >+ } >+ if (includeResource) { >+ result.add(cvsResource); >+ } >+ } >+ } >+ } >+ return (ICVSResource[]) result.toArray(new ICVSResource[result.size()]); >+ } >+ >+ public boolean isManaged() throws CVSException { >+ boolean result = super.isManaged(); >+ if (!result) { >+ FolderSyncInfo info = getFolderSyncInfo(); >+ if (info != null) // returns true is this is the root of the file system CVS repository >+ result = info.getRepository().equals(resource.lastSegment()); >+ } >+ return result; >+ } >+ >+ /** >+ * @see ICVSFolder#createFolder(String) >+ */ >+ public ICVSFolder getFolder(String name) throws CVSException { >+ if ((CURRENT_LOCAL_FOLDER.equals(name)) || ((CURRENT_LOCAL_FOLDER + SEPARATOR).equals(name))) >+ return this; >+ IPath folderLocation = resource.append(name); >+ IProject project = repositoryProvider.getProject(); >+ if (project != null) { >+ IContainer[]folders = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(URIUtil.toURI(folderLocation)); >+ if (folders.length > 0) { >+ for (int i = 0; i < folders.length; i++) { >+ if (folders[i].getProject().equals(project)) >+ return new EclipseFolder(folders[i]); >+ } >+ } >+ } >+ return new FileSystemFolder(folderLocation, repositoryProvider); >+ } >+ >+ /** >+ * @see ICVSFolder#createFile(String) >+ */ >+ public ICVSFile getFile(String name) throws CVSException { >+ IPath fileLocation = resource.append(name); >+ IProject project = repositoryProvider.getProject(); >+ if (project != null) { >+ IFile[]files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(URIUtil.toURI(fileLocation)); >+ if (files.length > 0) { >+ for (int i = 0; i < files.length; i++) { >+ if (files[i].exists() && files[i].getProject().equals(project)) >+ return new EclipseFile(files[i]); >+ } >+ } >+ } >+ return new FileSystemFile(fileLocation, repositoryProvider); >+ } >+ >+ /** >+ * @see ICVSFolder#mkdir() >+ */ >+ public void mkdir() throws CVSException { >+ resource.toFile().mkdir(); >+ // EclipseSynchronizer.getInstance().created(resource);; >+ } >+ >+ /** >+ * @see ICVSResource#isFolder() >+ */ >+ public boolean isFolder() { >+ return true; >+ } >+ >+ /** >+ * @see ICVSFolder#acceptChildren(ICVSResourceVisitor) >+ */ >+ public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException { >+ >+ // Visit files and then folders >+ ICVSResource[] subFiles = members(FILE_MEMBERS); >+ for (int i=0; i<subFiles.length; i++) { >+ subFiles[i].accept(visitor); >+ } >+ ICVSResource[] subFolders = members(FOLDER_MEMBERS); >+ for (int i=0; i<subFolders.length; i++) { >+ subFolders[i].accept(visitor); >+ } >+ } >+ >+ /** >+ * @see ICVSResource#accept(ICVSResourceVisitor) >+ */ >+ public void accept(ICVSResourceVisitor visitor) throws CVSException { >+ visitor.visitFolder(this); >+ } >+ >+ /** >+ * @see ICVSResource#accept(ICVSResourceVisitor, boolean) >+ */ >+ public void accept(ICVSResourceVisitor visitor, boolean recurse) throws CVSException { >+ visitor.visitFolder(this); >+ ICVSResource[] resources; >+ if (recurse) { >+ resources = members(ICVSFolder.ALL_MEMBERS); >+ } else { >+ resources = members(ICVSFolder.FILE_MEMBERS); >+ } >+ for (int i = 0; i < resources.length; i++) { >+ resources[i].accept(visitor, recurse); >+ } >+ } >+ >+ /** >+ * @see ICVSResource#getRemoteLocation(ICVSFolder) >+ */ >+ public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException { >+ >+ if (getFolderSyncInfo() != null) { >+ return getFolderSyncInfo().getRemoteLocation(); >+ } >+ >+ ICVSFolder parent = getParent(); >+ if(parent!=null && !equals(stopSearching)) { >+ String parentLocation; >+ parentLocation = parent.getRemoteLocation(stopSearching); >+ if (parentLocation!=null) { >+ return parentLocation + SEPARATOR + getName(); >+ } >+ } >+ return null; >+ } >+ >+ /* >+ * @see ICVSFolder#getFolderInfo() >+ */ >+ public FolderSyncInfo getFolderSyncInfo() throws CVSException { >+ return EclipseSynchronizer.getInstance().getFolderSync(resource); >+ } >+ >+ /* >+ * @see ICVSFolder#setFolderInfo(FolderSyncInfo) >+ */ >+ public void setFolderSyncInfo(final FolderSyncInfo folderInfo) throws CVSException { >+ // ignore folder sync on the root (i.e. CVSROOT/config/TopLevelAdmin=yes but we just ignore it) >+ if (resource.isRoot()) return; >+ run(new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) throws CVSException { >+ EclipseSynchronizer synchronizer = EclipseSynchronizer.getInstance(); >+ IResource workspaceResource = getIResource(); >+ if (workspaceResource != null) >+ synchronizer.setFolderSync((IContainer)workspaceResource, folderInfo); >+ else >+ synchronizer.setFolderSync(resource, folderInfo); >+ // the server won't add directories as sync info, therefore it must be done when >+ // a directory is shared with the repository. >+ byte[] newSyncBytes = new ResourceSyncInfo(getName()).getBytes(); >+ byte[] oldSyncBytes = getSyncBytes(); >+ // only set the bytes if the new differs from the old. >+ // this avoids unnecessary saving of sync files >+ if (oldSyncBytes == null || ! Util.equals(newSyncBytes, oldSyncBytes)) >+ setSyncBytes(newSyncBytes); >+ } >+ }, null); >+ >+ } >+ >+ /* >+ * @see ICVSFolder#isCVSFolder() >+ */ >+ public boolean isCVSFolder() throws CVSException { >+ return EclipseSynchronizer.getInstance().getFolderSync(resource) != null; >+ } >+ >+ /* >+ * @see ICVSResource#unmanage() >+ */ >+ public void unmanage(IProgressMonitor monitor) throws CVSException { >+ run(new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ recursiveUnmanage(resource.toFile(), Policy.subMonitorFor(monitor, 99)); >+ FileSystemFolder.super.unmanage(Policy.subMonitorFor(monitor, 1)); >+ monitor.done(); >+ } >+ }, Policy.subMonitorFor(monitor, 99)); >+ } >+ >+ /* private */ static void recursiveUnmanage(File container, IProgressMonitor monitor) { >+ try { >+ monitor.beginTask(null, 10); >+ monitor.subTask(NLS.bind(CVSMessages.EclipseFolder_0, new String[] {container.getAbsolutePath()})); >+ >+ File[] members = container.listFiles(); >+ for (int i = 0; i < members.length; i++) { >+ monitor.worked(1); >+ File resource = members[i]; >+ if (resource.isFile()) { >+ if (!resource.canWrite()) { >+ try { >+ IFileStore fileStore = EFS.getStore(resource.toURI()); >+ if (fileStore != null) { >+ IFileInfo fileInfo = fileStore.fetchInfo(); >+ if (fileInfo != null) >+ fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, false); >+ } >+ } catch (CoreException e) { >+ CVSException.wrapException(e); >+ } >+ } >+ } else { >+ recursiveUnmanage(resource, monitor); >+ } >+ } >+ } finally { >+ monitor.done(); >+ } >+ } >+ >+ /* >+ * @see ICVSResource#isIgnored() >+ */ >+ public boolean isIgnored() throws CVSException { >+ if(isCVSFolder()) { >+ return false; >+ } >+ return super.isIgnored(); >+ } >+ >+ /* >+ * @see ICVSFolder#getChild(String) >+ */ >+ public ICVSResource getChild(String namedPath) throws CVSException { >+ if (namedPath.equals(Session.CURRENT_LOCAL_FOLDER)) { >+ return this; >+ } >+ IPath newPath = resource.append(namedPath); >+ if(newPath.toFile().isFile()) >+ return getFile(namedPath); >+ else >+ return new FileSystemFolder(newPath, repositoryProvider); >+ } >+ >+ /** >+ * @see ICVSFolder#fetchChildren(IProgressMonitor) >+ */ >+ public ICVSResource[] fetchChildren(IProgressMonitor monitor) throws CVSException { >+ return members(FILE_MEMBERS | FOLDER_MEMBERS); >+ } >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#delete() >+ */ >+ public void delete() throws CVSException { >+ if (!exists()) return; >+ resource.toFile().delete(); >+ } >+ >+ /** >+ * Assumption this is only called from decorator and isIgnored() is purposely >+ * omitted here for performance reasons. >+ */ >+ public boolean isModified(IProgressMonitor monitor) throws CVSException { >+ return false; >+ } >+ >+ public void handleModification(boolean forAddition) throws CVSException { >+ // For non-additions, we are only interested in sync info changes >+ if (isIgnored() || !forAddition) return; >+ >+ // the folder is an addition. >+ FolderSyncInfo info = getFolderSyncInfo(); >+ // if the folder has sync info, it was handled is setFolderInfo >+ // otherwise, flush the ancestors to recalculate >+ if (info == null) { >+ EclipseSynchronizer.getInstance().setDirtyIndicator(getIResource(), true); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#getRepositoryRelativePath() >+ */ >+ public String getRepositoryRelativePath() throws CVSException { >+ FolderSyncInfo info = getFolderSyncInfo(); >+ if (info == null) return null; >+ // The REPOSITORY property of the folder info is the repository relative path >+ return info.getRepository(); >+ } >+} >Index: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemResource.java >=================================================================== >RCS file: src/org/eclipse/team/internal/ccvs/core/resources/FileSystemResource.java >diff -N src/org/eclipse/team/internal/ccvs/core/resources/FileSystemResource.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/internal/ccvs/core/resources/FileSystemResource.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,304 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.internal.ccvs.core.resources; >+ >+ >+import java.net.URI; >+ >+import org.eclipse.core.filesystem.URIUtil; >+import org.eclipse.core.resources.*; >+import org.eclipse.core.runtime.*; >+import org.eclipse.team.core.RepositoryProvider; >+import org.eclipse.team.internal.ccvs.core.*; >+import org.eclipse.team.internal.ccvs.core.client.Session; >+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; >+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; >+import org.eclipse.team.internal.ccvs.core.util.Util; >+ >+ >+/** >+ * Represents handles to CVS resource on the local file system. Synchronization >+ * information is taken from the CVS sub directories. >+ * >+ * @see LocalFolder >+ * @see LocalFile >+ */ >+abstract class FileSystemResource implements ICVSResource, Comparable { >+ >+ // The separator that must be used when creating CVS resource paths. Never use >+ // the platform default separator since it is not compatible with CVS resources. >+ protected static final String SEPARATOR = Session.SERVER_SEPARATOR; >+ protected static final String CURRENT_LOCAL_FOLDER = Session.CURRENT_LOCAL_FOLDER; >+ >+ /* >+ * The local resource represented by this handle >+ */ >+ IPath resource; >+ IResource cachedResource = null; >+ boolean cachedResourceInitialized = false; >+ RepositoryProvider repositoryProvider; >+ >+ public FileSystemResource(IPath resource, >+ RepositoryProvider repositoryProvider) { >+ this.resource = resource; >+ this.repositoryProvider = repositoryProvider; >+ } >+ >+ /* >+ * Get the extention of the path of resource relative to the path of root >+ * >+ * @throws CVSException if root is not a root-folder of resource >+ */ >+ public String getRelativePath(ICVSFolder root) throws CVSException { >+ try { >+ String result; >+ result = Util.getRelativePath(root.getLocation(), getLocation()); >+ if (result.length() == 0) return CURRENT_LOCAL_FOLDER; >+ return result; >+ } catch (ClassCastException e) { >+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, CVSMessages.EclipseResource_invalidResourceClass, e, root); >+ throw new CVSException(status); >+ } >+ } >+ >+ /* >+ * @see ICVSResource#exists() >+ */ >+ public boolean exists() { >+ return resource.toFile().exists(); >+ } >+ >+ /* >+ * Returns the parent folder of this resource of <code>null</code> if resource >+ * the resource. >+ * >+ * @see ICVSResource#getParent() >+ */ >+ public ICVSFolder getParent() { >+ if (resource.isRoot()) >+ return null; >+ IPath newResource = resource.removeLastSegments(1); >+ return new FileSystemFolder(newResource, repositoryProvider); >+ } >+ >+ /* >+ * @see ICVSResource#getName() >+ */ >+ public String getName() { >+ return resource.lastSegment(); >+ } >+ >+ /* >+ * @see ICVSResource#isIgnored() >+ */ >+ public boolean isIgnored() throws CVSException { >+ // a managed resource is never ignored >+ if(isManaged() || resource.isRoot()) { >+ return false; >+ } >+ >+ // always ignore CVS >+ String name = getName(); >+ if (name.equals("CVS")) return true; //$NON-NLS-1$ >+ >+ /* do something with the ignore files >+ // check ignore patterns from the .cvsignore file. >+ if(EclipseSynchronizer.getInstance().isIgnored(resource)) { >+ return true; >+ } >+ */ >+ >+ // check the parent, if the parent is ignored or mapped to CVSROOT/Emptydir >+ // then this resource is ignored also >+ ICVSFolder parent = getParent(); >+ if(parent==null) return false; >+ if (parent.isIgnored()) return true; >+ FolderSyncInfo info = parent.getFolderSyncInfo(); >+ if (info == null) return false; >+ return info.isVirtualDirectory(); >+ } >+ >+ /* >+ * @see ICVSResource#setIgnoredAs(String) >+ */ >+ public void setIgnoredAs(final String pattern) throws CVSException { >+ Assert.isTrue(false); >+ } >+ >+ /* >+ * @see ICVSResource#isManaged() >+ */ >+ public boolean isManaged() throws CVSException { >+ return isManaged(getSyncBytes()); >+ } >+ >+ /* >+ * Helper method that captures the sematics of isManaged given a ResourceSyncInfo >+ */ >+ public boolean isManaged(byte[] syncBytes) { >+ return syncBytes != null; >+ } >+ >+ /** >+ * Two ManagedResources are equal, if there cvsResources are >+ * equal (and that is, if the point to the same file) >+ */ >+ public boolean equals(Object obj) { >+ >+ if (!(obj instanceof ICVSResource)) { >+ return false; >+ } else { >+ return getLocation().equals(((ICVSResource) obj).getLocation()); >+ } >+ } >+ >+ /* >+ * @see ICVSResource#getPath() >+ */ >+ public String getPath() { >+ return resource.toString(); >+ } >+ >+ public IPath getLocation() { >+ return resource; >+ } >+ >+ /* >+ * @see ICVSResource#isFolder() >+ */ >+ public boolean isFolder() { >+ return resource.toFile().isDirectory(); >+ } >+ >+ /* >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#getSyncBytes() >+ */ >+ public byte[] getSyncBytes() throws CVSException { >+ return EclipseSynchronizer.getInstance().getSyncBytes(resource); >+ } >+ >+ /* >+ * @see org.eclipse.team.internal.ccvs.core.ICVSFile#setSyncBytes(byte[]) >+ */ >+ public void setSyncBytes(byte[] syncBytes) throws CVSException { >+ if (getParent().isCVSFolder()) { >+ IResource workspaceResource = getIResource(); >+ if (workspaceResource != null) >+ EclipseSynchronizer.getInstance().setSyncBytes(workspaceResource, syncBytes); >+ else >+ EclipseSynchronizer.getInstance().setSyncBytes(resource, syncBytes); >+ } >+ } >+ >+ /* >+ * @see ICVSResource#getSyncInfo() >+ */ >+ public ResourceSyncInfo getSyncInfo() throws CVSException { >+ return EclipseSynchronizer.getInstance().getResourceSync(resource); >+ } >+ >+ /* >+ * Implement the hashcode on the underlying strings, like it is done in the equals. >+ */ >+ public int hashCode() { >+ return getPath().hashCode(); >+ } >+ >+ /* >+ * Give the pathname back >+ */ >+ public String toString() { >+ return getPath(); >+ } >+ >+ /* >+ * @see ICVSResource#unmanage() >+ */ >+ public void unmanage(IProgressMonitor monitor) throws CVSException { >+ EclipseSynchronizer.getInstance().deleteResourceSync(resource); >+ } >+ >+ /* >+ * @see Comparable#compareTo(Object) >+ */ >+ public int compareTo(Object arg0) { >+ ICVSResource other = (ICVSResource)arg0; >+ return getLocation().toString().compareTo(other.getLocation().toString()); >+ } >+ >+ /** >+ * @see org.eclipse.team.internal.ccvs.core.ICVSResource#getIResource() >+ */ >+ public IResource getIResource() { >+ if (!cachedResourceInitialized) { >+ cachedResourceInitialized = true; >+ URI uri = URIUtil.toURI(resource); >+ IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri); >+ if (files.length > 0 && files[0].exists()) >+ cachedResource = files[0]; >+ else { >+ IContainer containers[] = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(uri); >+ if (containers.length > 0 && containers[0].exists()) >+ cachedResource = containers[0]; >+ } >+ } >+ return cachedResource; >+ } >+ >+ /** >+ * Called by a resource change listener when a resource is changed or added. This allows >+ * CVS resources to adjust any internal state based on the change. >+ * >+ * @param forAddition modification is an addition >+ * @throws CVSException >+ */ >+ public abstract void handleModification(boolean forAddition) throws CVSException; >+ >+ public void run(final ICVSRunnable job, IProgressMonitor monitor) throws CVSException { >+ final IProject project = repositoryProvider.getProject(); >+ if (project != null) { >+ final CVSException[] error = new CVSException[1]; >+ try { >+ // Do not use a scheduling rule in the workspace run since one >+ // will be obtained by the EclipseSynchronizer >+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { >+ public void run(IProgressMonitor monitor) throws CoreException { >+ try { >+ EclipseSynchronizer.getInstance().run(project, job, monitor); >+ } catch(CVSException e) { >+ error[0] = e; >+ } >+ } >+ }, null /* no rule */, 0, monitor); >+ } catch(CoreException e) { >+ throw CVSException.wrapException(e); >+ } >+ if(error[0]!=null) { >+ throw error[0]; >+ } >+ } >+ else { >+ final CVSException[] error = new CVSException[1]; >+ try { >+ job.run(monitor); >+ } catch(CVSException e) { >+ error[0] = e; >+ } >+ if(error[0]!=null) { >+ throw error[0]; >+ } >+ } >+ } >+ >+ public RepositoryProvider getProvider() { >+ return repositoryProvider; >+ } >+} >Index: src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java,v >retrieving revision 1.119 >diff -u -r1.119 RemoteFile.java >--- src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java 4 Aug 2008 11:03:38 -0000 1.119 >+++ src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java 1 Dec 2011 15:00:56 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.*; >+import org.eclipse.team.core.RepositoryProvider; > import org.eclipse.team.core.TeamException; > import org.eclipse.team.core.history.IFileRevision; > import org.eclipse.team.core.variants.CachedResourceVariant; >@@ -687,4 +688,8 @@ > ResourceSyncInfo info = getSyncInfo(); > return new CVSURI(getRepository(), new Path(getRepositoryRelativePath()), info.getTag(), info.getRevision()); > } >+ >+ public RepositoryProvider getProvider() { >+ return null; >+ } > } >Index: src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java,v >retrieving revision 1.92 >diff -u -r1.92 RemoteFolder.java >--- src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java 30 Mar 2007 20:18:44 -0000 1.92 >+++ src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java 1 Dec 2011 15:00:56 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.NLS; >+import org.eclipse.team.core.RepositoryProvider; > import org.eclipse.team.core.TeamException; > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.*; >@@ -594,5 +595,13 @@ > protected void fetchContents(IProgressMonitor monitor) throws TeamException { > // This should not get called for folders > } >+ >+ public RepositoryProvider getProvider() { >+ return null; >+ } >+ >+ public IPath getLocation() { >+ return null; >+ } > > } >Index: src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java,v >retrieving revision 1.53 >diff -u -r1.53 RemoteResource.java >--- src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java 10 May 2006 18:41:56 -0000 1.53 >+++ src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java 1 Dec 2011 15:00:57 -0000 >@@ -226,4 +226,8 @@ > public byte[] asBytes() { > return getSyncBytes(); > } >+ >+ public IPath getLocation() { >+ return null; >+ } > } >Index: src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java,v >retrieving revision 1.32 >diff -u -r1.32 CVSResourceVariantTree.java >--- src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java 8 Mar 2010 10:23:01 -0000 1.32 >+++ src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java 1 Dec 2011 15:00:57 -0000 >@@ -155,12 +155,17 @@ > > private byte[] getParentBytes(IResource resource) throws TeamException { > IContainer parent = resource.getParent(); >+ IPath parentLocation = resource.getLocation().removeLastSegments(1); >+ if (parentLocation.equals(parent.getLocation())) { > byte[] bytes = getByteStore().getBytes(parent); > if (bytes == null ) { > bytes = getBaseBytes(parent, getTag(resource)); > } > return bytes; > } >+ else >+ return getBaseBytes(parentLocation, getTag(resource), RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId())); >+ } > > private byte[] getBaseBytes(IContainer parent, CVSTag tag) throws CVSException { > byte[] bytes; >@@ -179,6 +184,23 @@ > return bytes; > } > >+ private byte[] getBaseBytes(IPath parent, CVSTag tag, RepositoryProvider repositoryProvider) throws CVSException { >+ byte[] bytes; >+ // Look locally for the folder bytes >+ ICVSFolder local = CVSFileSystemRoot.getCVSFolderFor(parent, repositoryProvider); >+ FolderSyncInfo info = local.getFolderSyncInfo(); >+ if (info == null) { >+ bytes = null; >+ } else { >+ // Use the folder sync from the workspace and the tag from the store >+ MutableFolderSyncInfo newInfo = info.cloneMutable(); >+ newInfo.setTag(tag); >+ newInfo.setStatic(false); >+ bytes = newInfo.getBytes(); >+ } >+ return bytes; >+ } >+ > private boolean hasLocalSyncInfo(IContainer folder) { > ICVSFolder local = CVSWorkspaceRoot.getCVSFolderFor(folder); > try { >Index: src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java,v >retrieving revision 1.14 >diff -u -r1.14 NotifyInfo.java >--- src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java 16 Mar 2007 21:03:50 -0000 1.14 >+++ src/org/eclipse/team/internal/ccvs/core/syncinfo/NotifyInfo.java 1 Dec 2011 15:00:57 -0000 >@@ -15,7 +15,7 @@ > import java.text.ParseException; > import java.util.Date; > >-import org.eclipse.core.resources.IContainer; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.internal.ccvs.core.*; >@@ -55,7 +55,7 @@ > * Constructor for a line from the CVS/Notify file > * @param line > */ >- public NotifyInfo(IContainer parent, String line) throws CVSException { >+ public NotifyInfo(IPath parent, String line) throws CVSException { > String[] strings = Util.parseIntoSubstrings(line, ResourceSyncInfo.SEPARATOR); > if(strings.length != 4) { > IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, NLS.bind(CVSMessages.NotifyInfo_MalformedLine, new String[] { line }), parent); >Index: src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java,v >retrieving revision 1.71 >diff -u -r1.71 SyncFileWriter.java >--- src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java 1 Feb 2010 10:52:22 -0000 1.71 >+++ src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java 1 Dec 2011 15:00:57 -0000 >@@ -15,8 +15,7 @@ > import java.net.URI; > import java.util.*; > >-import org.eclipse.core.filesystem.EFS; >-import org.eclipse.core.filesystem.IFileStore; >+import org.eclipse.core.filesystem.*; > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.NLS; >@@ -72,12 +71,23 @@ > return null; > } > >+ // process Entries file contents >+ String[] entries = readLines(cvsSubDir.getFile(ENTRIES)); >+ String[] entriesLog = readLines(cvsSubDir.getFile(ENTRIES_LOG)); >+ return readAllResourceSync(parent.getFullPath().toOSString(), entries, entriesLog); >+ } >+ >+ /** >+ * Reads the CVS/Entries, CVS/Entries.log and CVS/Permissions files from the >+ * specified folder and returns ResourceSyncInfo instances for the data stored therein. >+ * If the folder does not have a CVS subdirectory then <code>null</code> is returned. >+ */ >+ private static byte[][] readAllResourceSync(String userPath, String[] entries, String[] entriesLog) throws CVSException { > if (Policy.DEBUG_METAFILE_CHANGES) { >- System.out.println("Reading Entries file for " + parent.getFullPath()); //$NON-NLS-1$ >+ System.out.println("Reading Entries file for " + userPath); //$NON-NLS-1$ > } > > // process Entries file contents >- String[] entries = readLines(cvsSubDir.getFile(ENTRIES)); > if (entries == null) return null; > Map infos = new TreeMap(); > for (int i = 0; i < entries.length; i++) { >@@ -89,13 +99,12 @@ > } catch (CVSException e) { > // There was a problem parsing the entry line. > // Log the problem and skip the entry >- CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.SyncFileWriter_0, new String[] { parent.getFullPath().toString() }), e)); >+ CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.SyncFileWriter_0, new String[] { userPath }), e)); > } > } > } > > // process Entries.log file contents >- String[] entriesLog = readLines(cvsSubDir.getFile(ENTRIES_LOG)); > if (entriesLog != null) { > for (int i = 0; i < entriesLog.length; i++) { > String line = entriesLog[i]; >@@ -121,6 +130,20 @@ > return result; > } > >+ public static byte[][] readAllResourceSync(IPath parent) throws CVSException { >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ >+ if (!cvsSubDir.toFile().exists()){ >+ return null; >+ } >+ >+ // process Entries file contents >+ String[] entries = readLines(cvsSubDir.append(ENTRIES)); >+ // process Entries.log file contents >+ String[] entriesLog = readLines(cvsSubDir.append(ENTRIES_LOG)); >+ return readAllResourceSync(parent.toOSString(), entries, entriesLog); >+ } >+ > private static boolean folderExists(IFolder cvsSubDir) throws CVSException { > try { > URI uri = cvsSubDir.getLocationURI(); >@@ -136,6 +159,10 @@ > return false; > } > >+ private static boolean folderExists(IPath cvsSubDir) throws CVSException { >+ return cvsSubDir.toFile().exists(); >+ } >+ > public static void writeAllResourceSync(IContainer parent, byte[][] infos) throws CVSException { > try { > if (Policy.DEBUG_METAFILE_CHANGES) { >@@ -159,6 +186,34 @@ > throw CVSException.wrapException(e); > } > } >+ >+ public static void writeAllResourceSync(IPath parent, byte[][] infos) throws CVSException { >+ try { >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Writing Entries file for folder " + parent.toOSString()); //$NON-NLS-1$ >+ } >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ if (!cvsSubDir.toFile().exists()) { >+ cvsSubDir.toFile().mkdir(); >+ } >+ >+ // format file contents >+ String[] entries = new String[infos.length]; >+ for (int i = 0; i < infos.length; i++) { >+ byte[] info = infos[i]; >+ entries[i] = new String(info); >+ } >+ >+ // write Entries >+ writeLines(cvsSubDir.append(ENTRIES), entries); >+ >+ // delete Entries.log >+ cvsSubDir.append(ENTRIES_LOG).toFile().delete(); >+ } catch(IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ > /** > * Reads the CVS/Root, CVS/Repository, CVS/Tag, and CVS/Entries.static files from > * the specified folder and returns a FolderSyncInfo instance for the data stored therein. >@@ -211,6 +266,48 @@ > } > > /** >+ * Reads the CVS/Root, CVS/Repository, CVS/Tag, and CVS/Entries.static files from >+ * the specified folder and returns a FolderSyncInfo instance for the data stored therein. >+ * If the folder does not have a CVS subdirectory then <code>null</code> is returned. >+ */ >+ public static FolderSyncInfo readFolderSync(IPath folder) throws CVSException { >+ IPath cvsSubDir = getCVSSubdirectory(folder); >+ >+ if (!folderExists(cvsSubDir)){ >+ return null; >+ } >+ >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Reading Root/Repository files for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ >+ // read CVS/Root >+ String root = readFirstLine(cvsSubDir.append(ROOT)); >+ if (root == null) return null; >+ >+ // read CVS/Repository >+ String repository = readFirstLine(cvsSubDir.append(REPOSITORY)); >+ if (repository == null) return null; >+ >+ // read CVS/Tag >+ String tag = readFirstLine(cvsSubDir.append(TAG)); >+ if (Policy.DEBUG_METAFILE_CHANGES && tag != null) { >+ System.out.println("Reading Tag file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ CVSTag cvsTag = (tag != null) ? new CVSEntryLineTag(tag) : null; >+ >+ // read Entries.Static >+ String staticDir = readFirstLine(cvsSubDir.append(STATIC)); >+ if (Policy.DEBUG_METAFILE_CHANGES && staticDir != null) { >+ System.out.println("Reading Static file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ boolean isStatic = (staticDir != null); >+ >+ // return folder sync >+ return new FolderSyncInfo(repository, root, cvsTag, isStatic); >+ } >+ >+ /** > * Writes the CVS/Root, CVS/Repository, CVS/Tag, and CVS/Entries.static files to the > * specified folder using the data contained in the specified FolderSyncInfo instance. > */ >@@ -265,6 +362,62 @@ > } > > /** >+ * Writes the CVS/Root, CVS/Repository, CVS/Tag, and CVS/Entries.static files to the >+ * specified folder using the data contained in the specified FolderSyncInfo instance. >+ */ >+ public static void writeFolderSync(IPath folder, FolderSyncInfo info) throws CVSException { >+ try { >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Writing Root/Respository files for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ IPath cvsSubDir = createCVSSubdirectory(folder); >+ >+ // write CVS/Root >+ writeLines(cvsSubDir.append(ROOT), new String[] {info.getRoot()}); >+ >+ // write CVS/Repository >+ writeLines(cvsSubDir.append(REPOSITORY), new String[] {info.getRepository()}); >+ >+ // write CVS/Tag >+ IPath tagFile = cvsSubDir.append(TAG); >+ if (info.getTag() != null) { >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Writing Tag file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ writeLines(tagFile, new String[] {info.getTag().toEntryLineFormat(false)}); >+ } else { >+ if(tagFile.toFile().exists()) { >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Deleting Tag file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ tagFile.toFile().delete(); >+ } >+ } >+ >+ // write CVS/Entries.Static >+ IPath staticFile = cvsSubDir.append(STATIC); >+ if(info.getIsStatic()) { >+ // the existance of the file is all that matters >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Writing Static file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ writeLines(staticFile, new String[] {""}); //$NON-NLS-1$ >+ } else { >+ if(staticFile.toFile().exists()) { >+ if (Policy.DEBUG_METAFILE_CHANGES) { >+ System.out.println("Deleting Static file for " + folder.toOSString()); //$NON-NLS-1$ >+ } >+ staticFile.toFile().delete(); >+ } >+ } >+ } catch(CoreException e) { >+ throw CVSException.wrapException(e); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ /** > * Returns all .cvsignore entries for the specified folder. > */ > public static String[] readCVSIgnoreEntries(IContainer folder) throws CVSException { >@@ -328,15 +481,34 @@ > return null; > } > >- // process Notify file contents > String[] entries = readLines(cvsSubDir.getFile(NOTIFY)); >+ return readAllNotifyInfo(parent.getFullPath(), entries); >+ } >+ >+ /** >+ * Reads the CVS/Notify file from the specified folder and returns NotifyInfo instances >+ * for the data stored therein. If the folder does not have a CVS subdirectory then <code>null</code> is returned. >+ */ >+ public static NotifyInfo[] readAllNotifyInfo(IPath parent) throws CVSException { >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ >+ if (!folderExists(cvsSubDir)){ >+ return null; >+ } >+ >+ String[] entries = readLines(cvsSubDir.append(NOTIFY)); >+ return readAllNotifyInfo(parent, entries); >+ } >+ >+ private static NotifyInfo[] readAllNotifyInfo(IPath path, String[] entries) throws CVSException { >+ // process Notify file contents > if (entries == null) return null; > Map infos = new TreeMap(); > for (int i = 0; i < entries.length; i++) { > String line = entries[i]; > if(!"".equals(line)) { //$NON-NLS-1$ > try { >- NotifyInfo info = new NotifyInfo(parent, line); >+ NotifyInfo info = new NotifyInfo(path, line); > infos.put(info.getName(), info); > } catch (CVSException e) { > // We couldn't parse the notify info >@@ -383,6 +555,38 @@ > } > > /** >+ * Writes the CVS/Notify file to the specified folder using the data contained in the >+ * specified NotifyInfo instances. A CVS subdirectory must already exist (an exception >+ * is thrown if it doesn't). >+ */ >+ public static void writeAllNotifyInfo(IPath parent, NotifyInfo[] infos) throws CVSException { >+ // get the CVS directory >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ // write lines will throw an exception if the CVS directory does not exist >+ >+ if (infos.length == 0) { >+ IPath notifyFile = cvsSubDir.append(NOTIFY); >+ if(notifyFile.toFile().exists()) { >+ notifyFile.toFile().delete(); >+ } >+ } else { >+ // format file contents >+ String[] entries = new String[infos.length]; >+ for (int i = 0; i < infos.length; i++) { >+ NotifyInfo info = infos[i]; >+ entries[i] = info.getNotifyLine(); >+ } >+ >+ // write Notify entries >+ try { >+ writeLines(cvsSubDir.append(NOTIFY), entries); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ } >+ >+ /** > * Reads the CVS/Baserev file from the specified folder and returns > * BaserevInfo instances for the data stored therein. If the folder does not > * have a CVS subdirectory then <code>null</code> is returned. >@@ -396,6 +600,28 @@ > > // process Notify file contents > String[] entries = readLines(cvsSubDir.getFile(BASEREV)); >+ return readAllBaserevInfo(entries); >+ } >+ >+ /** >+ * Reads the CVS/Baserev file from the specified folder and returns >+ * BaserevInfo instances for the data stored therein. If the folder does not >+ * have a CVS subdirectory then <code>null</code> is returned. >+ */ >+ public static BaserevInfo[] readAllBaserevInfo(IPath parent) throws CVSException { >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ >+ if (!folderExists(cvsSubDir)){ >+ return null; >+ } >+ >+ // process Notify file contents >+ String[] entries = readLines(cvsSubDir.append(BASEREV)); >+ return readAllBaserevInfo(entries); >+ } >+ >+ private static BaserevInfo[] readAllBaserevInfo(String[] entries) >+ throws CVSException { > if (entries == null) return null; > Map infos = new TreeMap(); > for (int i = 0; i < entries.length; i++) { >@@ -419,15 +645,40 @@ > IFolder cvsSubDir = getCVSSubdirectory(parent); > // write lines will throw an exception if the CVS directory does not exist > >+ String[] entries = formatBaserevInfo(infos); >+ >+ // write Notify entries >+ writeLines(cvsSubDir.getFile(BASEREV), entries); >+ } >+ >+ /** >+ * Writes the CVS/Baserev file to the specified folder using the data >+ * contained in the specified BaserevInfo instances. A CVS subdirectory must >+ * already exist (an exception is thrown if it doesn't). >+ */ >+ public static void writeAllBaserevInfo(IPath parent, BaserevInfo[] infos) throws CVSException { >+ // get the CVS directory >+ IPath cvsSubDir = getCVSSubdirectory(parent); >+ // write lines will throw an exception if the CVS directory does not exist >+ >+ String[] entries = formatBaserevInfo(infos); >+ >+ // write Notify entries >+ try { >+ writeLines(cvsSubDir.append(BASEREV), entries); >+ } catch (IOException e) { >+ CVSException.wrapException(e); >+ } >+ } >+ >+ private static String[] formatBaserevInfo(BaserevInfo[] infos) { > // format file contents > String[] entries = new String[infos.length]; > for (int i = 0; i < infos.length; i++) { > BaserevInfo info = infos[i]; > entries[i] = info.getEntryLine(); > } >- >- // write Notify entries >- writeLines(cvsSubDir.getFile(BASEREV), entries); >+ return entries; > } > > /** >@@ -438,6 +689,13 @@ > } > > /** >+ * Returns the CVS subdirectory for this folder. >+ */ >+ private static IPath getCVSSubdirectory(IPath folder) { >+ return folder.append(CVS_DIRNAME); >+ } >+ >+ /** > * Creates and makes team-private and returns a CVS subdirectory in this folder. > */ > private static IFolder createCVSSubdirectory(IContainer folder) throws CVSException { >@@ -471,6 +729,16 @@ > } > } > >+ /** >+ * Creates and makes team-private and returns a CVS subdirectory in this folder. >+ */ >+ private static IPath createCVSSubdirectory(IPath folder) throws CVSException { >+ final IPath cvsSubDir = getCVSSubdirectory(folder); >+ if (! cvsSubDir.toFile().exists()) >+ cvsSubDir.toFile().mkdir(); >+ return cvsSubDir; >+ } >+ > protected static boolean existsInFileSystem(IFolder cvsSubDir) { > URI uri = cvsSubDir.getLocationURI(); > if (uri != null) { >@@ -493,6 +761,35 @@ > private static String readFirstLine(IFile file) throws CVSException { > try { > InputStream in = getInputStream(file); >+ return readFirstLine(in); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } catch (CoreException e) { >+ // If the IFile doesn't exist or the underlying File doesn't exist, >+ // just return null to indicate the absence of the file >+ if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND >+ || e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) >+ return null; >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ /* >+ * Reads the first line of the specified file. >+ * Returns null if the file does not exist, or the empty string if it is blank. >+ */ >+ private static String readFirstLine(IPath file) throws CVSException { >+ try { >+ if (!file.toFile().exists()) >+ return null; >+ InputStream in = new FileInputStream(file.toFile()); >+ return readFirstLine(in); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ private static String readFirstLine(InputStream in) throws IOException { > if (in != null) { > BufferedReader reader = new BufferedReader(new InputStreamReader(in), 512); > try { >@@ -504,16 +801,6 @@ > } > } > return null; >- } catch (IOException e) { >- throw CVSException.wrapException(e); >- } catch (CoreException e) { >- // If the IFile doesn't exist or the underlying File doesn't exist, >- // just return null to indicate the absence of the file >- if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND >- || e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) >- return null; >- throw CVSException.wrapException(e); >- } > } > > private static InputStream getInputStream(IFile file) throws CoreException, FileNotFoundException { >@@ -547,6 +834,20 @@ > private static String[] readLines(IFile file) throws CVSException { > try { > InputStream in = getInputStream(file); >+ return readLines(in); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } catch (CoreException e) { >+ // If the IFile doesn't exist or the underlying File doesn't exist, >+ // just return null to indicate the absence of the file >+ if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND >+ || e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) >+ return null; >+ throw CVSException.wrapException(e); >+ } >+ } >+ >+ private static String[] readLines(InputStream in) throws IOException { > if (in != null) { > BufferedReader reader = new BufferedReader(new InputStreamReader(in), 512); > List fileContentStore = new ArrayList(); >@@ -561,14 +862,19 @@ > } > } > return null; >- } catch (IOException e) { >- throw CVSException.wrapException(e); >- } catch (CoreException e) { >- // If the IFile doesn't exist or the underlying File doesn't exist, >- // just return null to indicate the absence of the file >- if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND >- || e.getStatus().getCode() == IResourceStatus.FAILED_READ_LOCAL) >+ } >+ >+ /* >+ * Reads all lines of the specified file. >+ * Returns null if the file does not exist. >+ */ >+ private static String[] readLines(IPath file) throws CVSException { >+ try { >+ if (!file.toFile().exists()) > return null; >+ InputStream in = new FileInputStream(file.toFile()); >+ return readLines(in); >+ } catch (IOException e) { > throw CVSException.wrapException(e); > } > } >@@ -604,6 +910,20 @@ > } > } > >+ /* >+ * Writes all lines to the specified file, using linefeed terminators for >+ * compatibility with other CVS clients. >+ */ >+ private static void writeLines(IPath file, final String[] contents) throws IOException, CVSException { >+ ByteArrayOutputStream os = new ByteArrayOutputStream(); >+ writeLinesToStreamAndClose(os, contents); >+ File javaFile = file.toFile(); >+ RandomAccessFile raFile = new RandomAccessFile(javaFile, "rw"); //$NON-NLS-1$ >+ raFile.write(os.toByteArray()); >+ raFile.setLength(os.toByteArray().length); >+ raFile.close(); >+ } >+ > private static void writeLinesToStreamAndClose(OutputStream os, String[] contents) throws CVSException { > byte[] lineEnd = getLineDelimiter(); > try { >@@ -650,6 +970,45 @@ > } > } > /** >+ * Method writeFileToBaseDirectory. >+ * >+ * @param file >+ * @param info >+ */ >+ public static void writeFileToBaseDirectory(IPath file, IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ try { >+ IPath baseFolder = getBaseDirectory(file); >+ if (!baseFolder.toFile().exists()) { >+ baseFolder.toFile().createNewFile(); >+ } >+ IPath target = baseFolder.append(file.lastSegment()); >+ if (target.toFile().exists()) { >+ // XXX Should ensure that we haven't already copied it >+ // XXX write the revision to the CVS/Baserev file >+ setReadOnly(target, false); >+ target.toFile().delete(); >+ } >+ InputStream in = new FileInputStream(file.toFile()); >+ OutputStream out = new FileOutputStream(target.toFile()); >+ >+ // Transfer bytes from in to out >+ byte[] buf = new byte[1024]; >+ int len; >+ while ((len = in.read(buf)) > 0) { >+ out.write(buf, 0, len); >+ } >+ in.close(); >+ out.close(); >+ target.toFile().setLastModified(file.toFile().lastModified()); >+ } catch (IOException e) { >+ throw CVSException.wrapException(e); >+ } finally { >+ monitor.done(); >+ } >+ } >+ /** > * Method restoreFileFromBaseDirectory. > * @param file > * @param info >@@ -678,6 +1037,35 @@ > monitor.done(); > } > } >+ /** >+ * Method restoreFileFromBaseDirectory. >+ * @param file >+ * @param info >+ * @param monitor >+ */ >+ public static void restoreFileFromBaseDirectory(IPath file, IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ try { >+ IPath baseFolder = getBaseDirectory(file); >+ IPath source = baseFolder.append(file.lastSegment()); >+ if (!source.toFile().exists()) { >+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, NLS.bind(CVSMessages.SyncFileWriter_baseNotAvailable, new String[] { file.toOSString() }), file); >+ throw new CVSException(status); >+ } >+ if (file.toFile().exists()) { >+ file.toFile().delete(); >+ } >+ // Make the source writable to avoid problems on some file systems (bug 109308) >+ setReadOnly(source, false); >+ // Copy the file so the timestamp is maintained >+ source.toFile().renameTo(file.toFile()); >+ } catch (CoreException e) { >+ throw CVSException.wrapException(e); >+ } finally { >+ monitor.done(); >+ } >+ } > > private static void setReadOnly(IFile source, boolean readOnly) { > ResourceAttributes attrs = source.getResourceAttributes(); >@@ -692,6 +1080,19 @@ > } > } > >+ private static void setReadOnly(IPath source, boolean readOnly) { >+ try { >+ IFileStore fileStore = EFS.getStore(source.toFile().toURI()); >+ if (fileStore != null) { >+ IFileInfo fileInfo = fileStore.fetchInfo(); >+ if (fileInfo != null) >+ fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, readOnly); >+ } >+ } catch (CoreException e) { >+ CVSException.wrapException(e); >+ } >+ } >+ > /** > * Method deleteFileFromBaseDirectory. > * @param file >@@ -714,12 +1115,38 @@ > } > } > >+ /** >+ * Method deleteFileFromBaseDirectory. >+ * @param file >+ * @param monitor >+ */ >+ public static void deleteFileFromBaseDirectory(IPath file, IProgressMonitor monitor) throws CVSException { >+ monitor = Policy.monitorFor(monitor); >+ monitor.beginTask(null, 100); >+ try { >+ IPath baseFolder = getBaseDirectory(file); >+ IPath source = baseFolder.append(file.lastSegment()); >+ if (source.toFile().exists()) { >+ setReadOnly(source, false); >+ source.toFile().delete(); >+ } >+ } finally { >+ monitor.done(); >+ } >+ } >+ > private static IFolder getBaseDirectory(IFile file) { > IContainer cvsFolder = getCVSSubdirectory(file.getParent()); > IFolder baseFolder = cvsFolder.getFolder(new Path(BASE_DIRNAME)); > return baseFolder; > } > >+ private static IPath getBaseDirectory(IPath file) { >+ IPath cvsFolder = getCVSSubdirectory(file.removeLastSegments(1)); >+ IPath baseFolder = cvsFolder.append(new Path(BASE_DIRNAME)); >+ return baseFolder; >+ } >+ > /** > * Return a handle to the CVS/Template file for the given folder > * @param folder >@@ -742,6 +1169,17 @@ > return baseFile.exists(); > } > >+ /** >+ * Method isEdited. >+ * @param resource >+ * @return boolean >+ */ >+ public static boolean isEdited(IPath file) { >+ IPath baseFolder = getBaseDirectory(file); >+ IPath baseFile = baseFolder.append(file.lastSegment()); >+ return baseFile.toFile().exists(); >+ } >+ > private static byte[] getLineDelimiter() { > if (CVSProviderPlugin.getPlugin().isUsePlatformLineend()) { > String property = System.getProperty("line.separator"); //$NON-NLS-1$ >Index: src/org/eclipse/team/internal/ccvs/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java,v >retrieving revision 1.51 >diff -u -r1.51 Util.java >--- src/org/eclipse/team/internal/ccvs/core/util/Util.java 13 Aug 2010 09:07:07 -0000 1.51 >+++ src/org/eclipse/team/internal/ccvs/core/util/Util.java 1 Dec 2011 15:00:57 -0000 >@@ -101,6 +101,40 @@ > return result; > } > >+ /* >+ * * >+ * Get the extention of the path of resource >+ * relative to the path of root >+ * >+ * @throws CVSException if root is not a root-folder of resource >+ */ >+ public static String getRelativePath(IPath rootName, IPath resourceName) >+ throws CVSException { >+ >+ if (!rootName.isPrefixOf(resourceName)) { >+ int count = rootName.matchingFirstSegments(resourceName); >+ if (count == 0) >+ throw new CVSException(CVSMessages.Util_Internal_error__resource_does_not_start_with_root_3); >+ resourceName = resourceName.removeFirstSegments(count); >+ for (int i = 0; i < rootName.segmentCount() - count; i++) >+ resourceName = new Path("..").append(resourceName); //$NON-NLS-1$ >+ return resourceName.toPortableString(); >+ } >+ >+ // Otherwise we would get an ArrayOutOfBoundException >+ // in case of two equal Resources >+ if (rootName.segmentCount() == resourceName.segmentCount()) { >+ return ""; //$NON-NLS-1$ >+ } >+ >+ // Remove leading slash if there is one >+ String result = resourceName.toString().substring(rootName.toString().length()); >+ if (result.startsWith("/")) { //$NON-NLS-1$ >+ result = result.substring(1); >+ } >+ return result; >+ } >+ > /** > * Append the prefix and suffix to form a valid CVS path. > */ >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java,v >retrieving revision 1.73 >diff -u -r1.73 CVSLightweightDecorator.java >--- src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java 10 Sep 2007 15:04:24 -0000 1.73 >+++ src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java 1 Dec 2011 15:01:00 -0000 >@@ -276,6 +276,7 @@ > ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); > cvsDecoration.setResourceType(resource.getType()); > >+ boolean locationIsNull = resource.getLocation() == null; > cvsDecoration.setHasRemote(hasRemote(cvsResource)); > if (cvsResource.isIgnored()) { > cvsDecoration.setIgnored(true); >@@ -304,7 +305,7 @@ > if (store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)) { > if (cvsResource.exists()) { > if (cvsResource.isFolder()) { >- if (!((ICVSFolder) cvsResource).isCVSFolder()) { >+ if (!((ICVSFolder) cvsResource).isCVSFolder() && !locationIsNull) { > cvsDecoration.setNewResource(true); > } > } else if (!cvsResource.isManaged()) { >Index: src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java,v >retrieving revision 1.30 >diff -u -r1.30 AddAction.java >--- src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java 3 Jun 2008 13:35:44 -0000 1.30 >+++ src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java 1 Dec 2011 15:01:00 -0000 >@@ -97,9 +97,6 @@ > * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForCVSResource(org.eclipse.team.internal.ccvs.core.ICVSResource) > */ > protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException { >- // Add to version control should never be enabled for linked resources >- IResource resource = cvsResource.getIResource(); >- if (resource.isLinked()) return false; > return super.isEnabledForCVSResource(cvsResource); > } > >Index: src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java,v >retrieving revision 1.34 >diff -u -r1.34 WorkspaceAction.java >--- src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java 9 Jun 2010 16:25:09 -0000 1.34 >+++ src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java 1 Dec 2011 15:01:01 -0000 >@@ -109,6 +109,7 @@ > * Recursively check for and handle orphaned CVS folders > */ > private void handleOrphanedSubtree(final ICVSFolder folder) throws CVSException { >+ if (folder.getIResource() != null) { > if (folder.getIResource().getType() == IResource.PROJECT) return; > if (CVSWorkspaceRoot.isOrphanedSubtree((IContainer)folder.getIResource())) { > try { >@@ -129,6 +130,7 @@ > } > handleOrphanedSubtree(folder.getParent()); > } >+ } > > /** > * Return true if the sync info is loaded for all selected resources. >Index: src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java,v >retrieving revision 1.11 >diff -u -r1.11 AddOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java 10 May 2006 17:48:12 -0000 1.11 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java 1 Dec 2011 15:01:01 -0000 >@@ -103,7 +103,7 @@ > * must be included in the resources array. > * </p> > */ >- private void add(CVSTeamProvider provider, IResource[] resources, int depth, IProgressMonitor progress) throws CVSException { >+ private void add(final CVSTeamProvider provider, IResource[] resources, int depth, final IProgressMonitor progress) throws CVSException { > > // Visit the children of the resources using the depth in order to > // determine which folders, text files and binary files need to be added >@@ -121,7 +121,10 @@ > // Auto-add parents if they are not already managed > IContainer parent = currentResource.getParent(); > ICVSResource cvsParentResource = CVSWorkspaceRoot.getCVSResourceFor(parent); >- while (parent.getType() != IResource.ROOT && parent.getType() != IResource.PROJECT && ! isManaged(cvsParentResource)) { >+ while (parent.getType() != IResource.ROOT >+ && parent.getType() != IResource.PROJECT >+ && ! isManaged(cvsParentResource) >+ && cvsParentResource.getLocation() != null) { > folders.add(cvsParentResource); > parent = parent.getParent(); > cvsParentResource = cvsParentResource.getParent(); >@@ -135,7 +138,7 @@ > ICVSResource mResource = CVSWorkspaceRoot.getCVSResourceFor(resource); > // Add the resource is its not already managed and it was either > // added explicitly (is equal currentResource) or is not ignored >- if (! isManaged(mResource) && (currentResource.equals(resource) || ! mResource.isIgnored())) { >+ if ((mResource.getLocation() != null) && !isManaged(mResource) && (currentResource.equals(resource) || ! mResource.isIgnored())) { > if (resource.getType() == IResource.FILE) { > KSubstOption ksubst= getKSubstOption((IFile)resource); > Set set = (Set) files.get(ksubst); >@@ -172,14 +175,16 @@ > progress.beginTask(null, files.size() * 10 + (folders.isEmpty() ? 0 : 10)); > try { > if (!folders.isEmpty()) { >- Session session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ LocalRootRunnable runnable = new LocalRootRunnable(provider) { >+ public void executeSession(ICVSFolder localRoot, ICVSResource resources[], boolean recurse) throws CVSException, InterruptedException { >+ Session session = new Session(getRemoteLocation(provider), localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(progress, 2), true /* open for modification */); > try { > IStatus status = Command.ADD.execute( > session, > Command.NO_GLOBAL_OPTIONS, > Command.NO_LOCAL_OPTIONS, >- (ICVSResource[])folders.toArray(new ICVSResource[folders.size()]), >+ resources, > null, > Policy.subMonitorFor(progress, 8)); > if (status.getCode() == CVSStatus.SERVER_ERROR) { >@@ -189,18 +194,23 @@ > session.close(); > } > } >+ }; >+ runnable.run(getLocalRoot(provider), (ICVSResource[]) folders.toArray(new ICVSResource[0]), false); >+ } > for (Iterator it = files.entrySet().iterator(); it.hasNext();) { > Map.Entry entry = (Map.Entry) it.next(); > final KSubstOption ksubst = (KSubstOption) entry.getKey(); > final Set set = (Set) entry.getValue(); >- Session session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ LocalRootRunnable runnable = new LocalRootRunnable(provider) { >+ public void executeSession(ICVSFolder localRoot, ICVSResource resources[], boolean recurse) throws CVSException, InterruptedException { >+ Session session = new Session(getRemoteLocation(provider), localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(progress, 2), true /* open for modification */); > try { > IStatus status = Command.ADD.execute( > session, > Command.NO_GLOBAL_OPTIONS, > new LocalOption[] { ksubst }, >- (ICVSResource[])set.toArray(new ICVSResource[set.size()]), >+ resources, > null, > Policy.subMonitorFor(progress, 8)); > if (status.getCode() == CVSStatus.SERVER_ERROR) { >@@ -210,6 +220,11 @@ > session.close(); > } > } >+ }; >+ runnable.run(getLocalRoot(provider), (ICVSResource[]) set.toArray(new ICVSResource[0]), false); >+ } >+ } catch (InterruptedException e) { >+ CVSException.wrapException(e); > } finally { > progress.done(); > } >Index: src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java,v >retrieving revision 1.19 >diff -u -r1.19 BranchOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java 3 Jun 2008 13:35:45 -0000 1.19 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/BranchOperation.java 1 Dec 2011 15:01:01 -0000 >@@ -130,21 +130,22 @@ > } > } > >- private void makeBranch(CVSTeamProvider provider, IResource[] resources, final CVSTag versionTag, final CVSTag branchTag, boolean moveToBranch, boolean recurse, IProgressMonitor monitor) throws TeamException { >+ private void makeBranch(final CVSTeamProvider provider, IResource[] resources, final CVSTag versionTag, final CVSTag branchTag, boolean moveToBranch, boolean recurse, final IProgressMonitor monitor) throws TeamException { > > // Determine the total amount of work > int totalWork = (versionTag!= null ? 60 : 40) + (moveToBranch ? 20 : 0); > monitor.beginTask(CVSUIMessages.CVSTeamProvider_makeBranch, totalWork); > try { > // Build the arguments list >+ LocalRootRunnable runnable = new LocalRootRunnable() { >+ public void executeSession(ICVSFolder localRoot, IResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException { > ICVSResource[] arguments = getCVSArguments(resources); > LocalOption[] localOptions = getLocalOptions(recurse); >- > // Tag the remote resources > IStatus status = null; > if (versionTag != null) { > // Version using a custom tag command that skips added but not commited reesources >- Session session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ Session session = new Session(getRemoteLocation(provider),localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(monitor, 5), true /* open for modification */); > try { > status = Command.CUSTOM_TAG.execute( >@@ -160,7 +161,7 @@ > } > if (status.isOK()) { > // Branch using the tag >- session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ session = new Session(getRemoteLocation(provider), localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(monitor, 5), true /* open for modification */); > try { > status = Command.CUSTOM_TAG.execute( >@@ -177,7 +178,7 @@ > } > } else { > // Just branch using tag >- Session session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ Session session = new Session(getRemoteLocation(provider), localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(monitor, 5), true /* open for modification */); > try { > status = Command.CUSTOM_TAG.execute( >@@ -191,17 +192,20 @@ > } finally { > session.close(); > } >- > } > if ( ! status.isOK()) { > throw new CVSServerException(status); > } >- >+ } >+ }; >+ runnable.run(getLocalRoot(provider), resources, recurse); > // Set the tag of the local resources to the branch tag (The update command will not > // properly update "cvs added" and "cvs removed" resources so a custom visitor is used > if (moveToBranch) { > setTag(provider, resources, branchTag, recurse, Policy.subMonitorFor(monitor, 20)); > } >+ } catch (InterruptedException e) { >+ CVSException.wrapException(e); > } finally { > monitor.done(); > } >Index: src/org/eclipse/team/internal/ccvs/ui/operations/LocalRootRunnable.java >=================================================================== >RCS file: src/org/eclipse/team/internal/ccvs/ui/operations/LocalRootRunnable.java >diff -N src/org/eclipse/team/internal/ccvs/ui/operations/LocalRootRunnable.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/LocalRootRunnable.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,395 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.internal.ccvs.ui.operations; >+ >+import java.util.*; >+ >+import org.eclipse.core.resources.IContainer; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.*; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.team.internal.ccvs.core.*; >+import org.eclipse.team.internal.ccvs.core.client.*; >+import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener; >+import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; >+import org.eclipse.team.internal.ccvs.core.resources.CVSFileSystemRoot; >+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; >+import org.eclipse.team.internal.ccvs.ui.Policy; >+ >+public class LocalRootRunnable { >+ >+ private CVSTeamProvider provider; >+ >+ public LocalRootRunnable() { >+ super(); >+ } >+ >+ public LocalRootRunnable(CVSTeamProvider provider) { >+ super(); >+ this.provider = provider; >+ } >+ >+ protected void executeSession(ICVSFolder localRoot, IResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException {} >+ >+ protected void executeSession(ICVSFolder localRoot, ICVSResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException {} >+ >+ protected IStatus executeSessionWithStatus(ICVSFolder localRoot, IResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException {return Status.OK_STATUS;} >+ >+ protected IStatus executeSessionWithStatus(ICVSFolder localRoot, ICVSResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException {return Status.OK_STATUS;} >+ >+ private static class Root >+ { >+ public Root(ICVSFolder localRoot, List resources, boolean recurse) { >+ super(); >+ this.localRoot = localRoot; >+ this.resources = resources; >+ this.recurse = recurse; >+ } >+ ICVSFolder localRoot; >+ List resources; // either IResource or ICVSResource >+ boolean recurse; >+ >+ public boolean contains(Root newRoot) { >+ if (localRoot.getClass().equals(newRoot.localRoot.getClass()) && (recurse == newRoot.recurse)) >+ return localRoot.getLocation().isPrefixOf(newRoot.localRoot.getLocation()); >+ return false; >+ } >+ >+ public void merge(Root root) { >+ ArrayList newList = new ArrayList(resources); >+ resources = newList; >+ resources.addAll(root.resources); >+ } >+ } >+ >+ /* >+ * Represents either a IResource or ICVSResource >+ */ >+ private static class CommonResource { >+ IResource workspaceResource = null; >+ ICVSResource cvsResource = null; >+ >+ public CommonResource(ICVSResource resource) { >+ cvsResource = resource; >+ } >+ >+ public CommonResource(IResource resource) { >+ workspaceResource = resource; >+ } >+ >+ public String toString() { >+ if (cvsResource != null) >+ return cvsResource.toString(); >+ return workspaceResource.toString(); >+ } >+ >+ public boolean isFolder() { >+ if (cvsResource != null) >+ return cvsResource.isFolder(); >+ return workspaceResource instanceof IContainer; >+ } >+ >+ public IPath getLocation() { >+ if (cvsResource != null) >+ return cvsResource.getLocation(); >+ return workspaceResource.getLocation(); >+ } >+ >+ public CommonResource[] members() throws CoreException { >+ if (cvsResource != null) { >+ ICVSResource[] resources = ((ICVSFolder) cvsResource).members(ICVSFolder.FILE_MEMBERS | ICVSFolder.FOLDER_MEMBERS); >+ CommonResource[] result = new CommonResource[resources.length]; >+ for (int i = 0; i < result.length; i++) >+ result[i] = new CommonResource(resources[i]); >+ return result; >+ } >+ IResource[] resources = ((IContainer) workspaceResource).members(); >+ CommonResource[] result = new CommonResource[resources.length]; >+ for (int i = 0; i < result.length; i++) >+ result[i] = new CommonResource(resources[i]); >+ return result; >+ } >+ >+ public ICVSResource getCVSResource() { >+ if (cvsResource != null) >+ return cvsResource; >+ return CVSWorkspaceRoot.getCVSResourceFor(workspaceResource); >+ } >+ } >+ >+ /* >+ * Returns the root that is sufficient to accommodate all resources to be committed. >+ * For example, if the local root's location is c:\foo\bar\, but the resource's location >+ * is c:\foo\other\res.txt, the common root will be 'c:\foo' >+ */ >+ private Root[] getCommonRoots(ICVSFolder localRoot, >+ IResource[] resources, boolean recurse) throws CVSException { >+ ArrayList/*<Root>*/ list = new ArrayList(); >+ getCommonRoots(list, localRoot, toCommonRootArray(resources), recurse); >+ return (Root[]) list.toArray(new Root[0]); >+ } >+ >+ private CommonResource[] toCommonRootArray(IResource[] resources) { >+ CommonResource[] result = new CommonResource[resources.length]; >+ for (int i = 0;i < resources.length; i++) >+ result[i] = new CommonResource(resources[i]); >+ return result; >+ } >+ >+ private Root[] getCommonRoots(ICVSFolder localRoot, >+ ICVSResource[] resources, boolean recurse) throws CVSException { >+ ArrayList/*<Root>*/ list = new ArrayList(); >+ getCommonRoots(list, localRoot, toCommonRootArray(resources), recurse); >+ return (Root[]) list.toArray(new Root[0]); >+ } >+ >+ private CommonResource[] toCommonRootArray(ICVSResource[] resources) { >+ CommonResource[] result = new CommonResource[resources.length]; >+ for (int i = 0;i < resources.length; i++) >+ result[i] = new CommonResource(resources[i]); >+ return result; >+ } >+ >+ private ICVSFolder selectAppropriateRoot(ICVSResource cvsResource) >+ throws CVSException { >+ ICVSFolder newRoot = null; >+ IPath location = cvsResource.getLocation(); >+ if (!cvsResource.isFolder()) >+ newRoot = cvsResource.getParent(); >+ else >+ newRoot = (ICVSFolder) cvsResource; >+ while (newRoot != null && !newRoot.isCVSFolder() && newRoot.getLocation().isPrefixOf(location)) { >+ newRoot = newRoot.getParent(); >+ } >+ if ( newRoot != null && (!newRoot.isCVSFolder() || !newRoot.getLocation().isPrefixOf(location))) >+ newRoot = null; >+ return newRoot; >+ } >+ >+ private boolean isCVSResource(ICVSResource cvsResource) throws CVSException { >+ ICVSFolder root = null; >+ if (!cvsResource.isFolder()) >+ root = cvsResource.getParent(); >+ else >+ root = (ICVSFolder) cvsResource; >+ >+ while (root != null && !root.isCVSFolder() && root.getLocation().isPrefixOf(cvsResource.getLocation())) { >+ root = root.getParent(); >+ } >+ >+ return !(root == null); >+ } >+ >+ /* >+ * Returns true if the root was changed >+ */ >+ private boolean getCommonRoots(ArrayList list, ICVSFolder localRoot, >+ CommonResource[] resources, boolean recurse) throws CVSException { >+ boolean wasChanged = false; >+ IPath rootLocation = localRoot.getLocation(); >+ if (rootLocation != null) { >+ ArrayList/*<CommonResource>*/ notAdded = new ArrayList(); >+ Vector notCVS = new Vector(); >+ for (int i = 0; i < resources.length; i++) { >+ boolean added = false; >+ boolean isCVS = true; >+ IPath location = resources[i].getLocation(); >+ if (location != null) { >+ if (!rootLocation.isPrefixOf(location)) { >+ // first, try to get the root as the resource itself, and its immediate workspace parents. >+ CommonResource cvsResource = resources[i]; >+ if (isCVSResource(cvsResource.getCVSResource())) { >+ ICVSFolder newRoot = null; >+ newRoot = selectAppropriateRoot(cvsResource.getCVSResource()); >+ >+ if (newRoot == null) { >+ // create FileSystem Parent Resources. >+ cvsResource = new CommonResource(CVSFileSystemRoot.getCVSResourceFor(cvsResource.getLocation(), localRoot.getProvider())); >+ newRoot = selectAppropriateRoot(cvsResource.getCVSResource()); >+ } >+ if (newRoot == null) >+ throw new CVSException(new CVSStatus(IStatus.ERROR, >+ CVSMessages.CVSRepositoryLocation_mixedRepository)); >+ added = true; >+ wasChanged = true; >+ getCommonChildrenRoots(list, new CommonResource[] {resources[i]}, recurse, newRoot); >+ } else { >+ notCVS.add(resources[i]); >+ isCVS = false; >+ } >+ } >+ } >+ if (!added && isCVS) >+ notAdded.add(resources[i]); >+ } >+ if (!notAdded.isEmpty()) >+ wasChanged |= getCommonChildrenRoots(list, (CommonResource[]) notAdded.toArray(new CommonResource[0]), recurse, localRoot); >+ >+ // write to log the files that are located somewhere not under cvs root >+ if (!notCVS.isEmpty()) { >+ if (provider != null) { >+ Session session = new Session(provider.getCVSWorkspaceRoot().getRemoteLocation(), localRoot, true); >+ session.open(Policy.subMonitorFor(null, 2), true /* open for modification */); >+ try { >+ ICommandOutputListener listener = new CommandOutputListener(); >+ for (int i = 0; i < notCVS.size(); i++){ >+ CommonResource cvsResource = (CommonResource) notCVS.get(i); >+ String argument = NLS.bind(CVSMessages.Resource_not_in_CVS, >+ new String[] {cvsResource.getCVSResource().getRelativePath(localRoot), >+ cvsResource.getLocation().toString()}); >+ IStatus status = listener.messageLine(argument, session.getCVSRepositoryLocation(), session.getLocalRoot(), null); >+ session.addError(status); // The session ignores OK status >+ ConsoleListeners.getInstance().messageLineReceived(session, argument, status); >+ } >+ } finally { >+ session.close(); >+ } >+ } >+ } >+ } >+ else >+ wasChanged = getCommonChildrenRoots(list, resources, recurse, localRoot); >+ return wasChanged; >+ } >+ >+ private boolean getCommonChildrenRoots(ArrayList list, >+ CommonResource[] resources, boolean recurse, ICVSFolder newRoot) >+ throws CVSException { >+ boolean wasChanged = false; >+ if (recurse) { >+ boolean hadFolderChildren = false; >+ ArrayList/*<CommonResource>*/ notAdded = new ArrayList(); >+ for (int i = 0; i < resources.length; i++) { >+ CommonResource resource = resources[i]; >+ if (resource.isFolder()) { >+ hadFolderChildren = true; >+ try { >+ CommonResource[] resChildren = null; >+ try { >+ resChildren = resource.members(); >+ } catch (CoreException e) { >+ addToList(list, new Root(newRoot, Arrays.asList(new CommonResource[] {resource}), true)); >+ } >+ if (resChildren != null) { >+ ArrayList childrenList = new ArrayList(); >+ boolean changed = getCommonRoots(childrenList, newRoot, resChildren, true); >+ if (changed) { >+ list.addAll(childrenList); >+ recurse = false; >+ wasChanged = true; >+ } >+ else { >+ if (!newRoot.getLocation().isPrefixOf(resource.getLocation())) { >+ ICVSFolder localRoot = selectAppropriateRoot(newRoot); >+ addToList(list, new Root(localRoot, Arrays.asList(new CommonResource[] {resource}), true)); >+ } >+ else >+ notAdded.add(resource); >+ } >+ } >+ } catch (CoreException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ else >+ notAdded.add(resource); >+ } >+ if (!notAdded.isEmpty()) >+ addToList(list, new Root(newRoot, notAdded, recurse && hadFolderChildren)); >+ } >+ else >+ addToList(list, new Root(newRoot, Arrays.asList(resources), recurse)); >+ return wasChanged; >+ } >+ >+ private void addToList(ArrayList list, Root newRoot) { >+ Iterator it = list.iterator(); >+ while (it.hasNext()) { >+ Root root = (Root) it.next(); >+ if (root.contains(newRoot)) { >+ root.merge(newRoot); >+ return; >+ } >+ if (newRoot.contains(root)) { >+ newRoot.merge(root); >+ list.remove(root); >+ list.add(newRoot); >+ return; >+ } >+ } >+ list.add(newRoot); >+ } >+ >+ public void run(ICVSFolder localRoot, IResource[] resources, >+ boolean recurse) throws CVSException, InterruptedException, CVSServerException { >+ Root commonRoots[] = getCommonRoots(localRoot, resources, recurse); >+ for (int i = 0; i < commonRoots.length; i++) { >+ IResource [] array = toIResourceArray(commonRoots[i].resources); >+ executeSession(commonRoots[i].localRoot, array, commonRoots[i].recurse); >+ } >+ } >+ >+ public IStatus runWithStatus(ICVSFolder localRoot, IResource[] resources, >+ boolean recurse) throws CVSException, InterruptedException, CVSServerException { >+ Root commonRoots[] = getCommonRoots(localRoot, resources, recurse); >+ for (int i = 0; i < commonRoots.length; i++) { >+ IResource [] array = toIResourceArray(commonRoots[i].resources); >+ IStatus status = executeSessionWithStatus(commonRoots[i].localRoot, array, commonRoots[i].recurse); >+ if (!status.isOK()) >+ return status; >+ } >+ return Status.OK_STATUS; >+ } >+ >+ private IResource[] toIResourceArray(List resources) { >+ IResource[] result = new IResource[resources.size()]; >+ Iterator it = resources.iterator(); >+ int i = 0; >+ while (it.hasNext()) { >+ CommonResource commonRes = (CommonResource) it.next(); >+ result[i++] = commonRes.workspaceResource; >+ } >+ return result; >+ } >+ >+ public void run(ICVSFolder localRoot, ICVSResource[] resources, >+ boolean recurse) throws CVSException, InterruptedException, CVSServerException { >+ Root commonRoots[] = getCommonRoots(localRoot, resources, recurse); >+ for (int i = 0; i < commonRoots.length; i++) { >+ ICVSResource [] array = toICVSResourceArray(commonRoots[i].resources); >+ executeSession(commonRoots[i].localRoot, array, commonRoots[i].recurse); >+ } >+ } >+ >+ public IStatus runWithStatus(ICVSFolder localRoot, ICVSResource[] resources, >+ boolean recurse) throws CVSException, InterruptedException, CVSServerException { >+ Root commonRoots[] = getCommonRoots(localRoot, resources, recurse); >+ for (int i = 0; i < commonRoots.length; i++) { >+ ICVSResource [] array = toICVSResourceArray(commonRoots[i].resources); >+ IStatus status = executeSessionWithStatus(commonRoots[i].localRoot, array, commonRoots[i].recurse); >+ if (!status.isOK()) >+ return status; >+ } >+ return Status.OK_STATUS; >+ } >+ >+ private ICVSResource[] toICVSResourceArray(List resources) { >+ ICVSResource[] result = new ICVSResource[resources.size()]; >+ Iterator it = resources.iterator(); >+ int i = 0; >+ while (it.hasNext()) { >+ CommonResource commonRes = (CommonResource) it.next(); >+ result[i++] = commonRes.cvsResource; >+ } >+ return result; >+ } >+} >Index: src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java,v >retrieving revision 1.40 >diff -u -r1.40 RepositoryProviderOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java 24 May 2010 13:43:28 -0000 1.40 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java 1 Dec 2011 15:01:04 -0000 >@@ -27,7 +27,6 @@ > import org.eclipse.team.core.mapping.provider.SynchronizationScopeManager; > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.Command; >-import org.eclipse.team.internal.ccvs.core.client.Session; > import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; > import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; > import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; >@@ -387,15 +386,12 @@ > /* > * Get the arguments to be passed to a commit or update > */ >- protected String[] getStringArguments(IResource[] resources) throws CVSException { >+ protected String[] getStringArguments(ICVSFolder localRoot, IResource[] resources) throws CVSException { > List arguments = new ArrayList(resources.length); > for (int i=0;i<resources.length;i++) { >- IPath cvsPath = resources[i].getFullPath().removeFirstSegments(1); >- if (cvsPath.segmentCount() == 0) { >- arguments.add(Session.CURRENT_LOCAL_FOLDER); >- } else { >- arguments.add(cvsPath.toString()); >- } >+ ICVSResource res = CVSWorkspaceRoot.getCVSResourceFor(resources[i]); >+ String path = res.getRelativePath(localRoot); >+ arguments.add(path); > } > return (String[])arguments.toArray(new String[arguments.size()]); > } >Index: src/org/eclipse/team/internal/ccvs/ui/operations/SingleCommandOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/SingleCommandOperation.java,v >retrieving revision 1.18 >diff -u -r1.18 SingleCommandOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/SingleCommandOperation.java 29 Mar 2006 17:13:56 -0000 1.18 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/SingleCommandOperation.java 1 Dec 2011 15:01:04 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.team.internal.ccvs.core.client.Command; > import org.eclipse.team.internal.ccvs.core.client.Session; > import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; >+import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; > import org.eclipse.team.internal.ccvs.ui.Policy; > import org.eclipse.ui.IWorkbenchPart; > >@@ -34,9 +35,11 @@ > /* (non-Javadoc) > * @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor) > */ >- protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException { >+ protected void execute(final CVSTeamProvider provider, IResource[] resources, boolean recurse, final IProgressMonitor monitor) throws CVSException, InterruptedException { > monitor.beginTask(null, 100); >- Session session = new Session(getRemoteLocation(provider), getLocalRoot(provider), true /* output to console */); >+ LocalRootRunnable runnable = new LocalRootRunnable() { >+ public void executeSession(ICVSFolder localRoot, IResource resources[], boolean recurse) throws CVSException, InterruptedException, CVSServerException { >+ Session session = new Session(getRemoteLocation(provider), localRoot, true /* output to console */); > session.open(Policy.subMonitorFor(monitor, 10), isServerModificationOperation()); > try { > IStatus status = executeCommand(session, provider, getCVSArguments(session, resources), recurse, Policy.subMonitorFor(monitor, 90)); >@@ -47,6 +50,9 @@ > session.close(); > } > } >+ }; >+ runnable.run(getLocalRoot(provider), resources, recurse); >+ } > > protected final ICVSResource[] getCVSArguments(IResource[] resources) { > return super.getCVSArguments(resources); >Index: src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java,v >retrieving revision 1.22 >diff -u -r1.22 TagOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java 10 Apr 2006 14:27:03 -0000 1.22 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/TagOperation.java 1 Dec 2011 15:01:04 -0000 >@@ -24,6 +24,7 @@ > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.*; > import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; >+import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; > import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; > import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; > import org.eclipse.team.internal.ccvs.ui.Policy; >@@ -79,8 +80,13 @@ > * any other code - warning messages received from the server > * @param recurse > */ >- public IStatus tag(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor progress) throws CVSException { >+ public IStatus tag(final CVSTeamProvider provider, IResource[] resources, boolean recurse, final IProgressMonitor progress) throws CVSException { > >+ LocalRootRunnable runnable = new LocalRootRunnable() { >+ protected IStatus executeSessionWithStatus(ICVSFolder localRoot, >+ IResource[] resources, boolean recurse) >+ throws CVSException, InterruptedException, >+ CVSServerException { > LocalOption[] commandOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]); > if (recurse) { > commandOptions = Command.DO_NOT_RECURSE.removeFrom(commandOptions); >@@ -90,11 +96,11 @@ > } > > // Build the arguments list >- String[] arguments = getStringArguments(resources); >+ String[] arguments = getStringArguments(localRoot, resources); > > // Execute the command > CVSWorkspaceRoot root = provider.getCVSWorkspaceRoot(); >- Session s = new Session(root.getRemoteLocation(), root.getLocalRoot()); >+ Session s = new Session(root.getRemoteLocation(), localRoot); > progress.beginTask(null, 100); > try { > // Opening the session takes 20% of the time >@@ -110,6 +116,12 @@ > s.close(); > progress.done(); > } >+ } }; >+ try { >+ return runnable.runWithStatus(provider.getCVSWorkspaceRoot().getLocalRoot(), resources, recurse); >+ } catch (InterruptedException e) { >+ throw CVSException.wrapException(e); >+ } > } > > public void addLocalOption(LocalOption option) { >#P org.eclipse.team.tests.cvs.core >Index: launchConfigurations/CVS UI Tests (1).launch >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests (1).launch,v >retrieving revision 1.1 >diff -u -r1.1 CVS UI Tests (1).launch >--- launchConfigurations/CVS UI Tests (1).launch 6 May 2005 15:44:38 -0000 1.1 >+++ launchConfigurations/CVS UI Tests (1).launch 1 Dec 2011 15:01:06 -0000 >@@ -1,166 +1,180 @@ >-<?xml version="1.0" encoding="UTF-8"?> >+<?xml version="1.0" encoding="UTF-8" standalone="no"?> > <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> >-<stringAttribute key="product" value="org.eclipse.platform.ide"/> >+<booleanAttribute key="askclear" value="false"/> >+<booleanAttribute key="automaticAdd" value="true"/> >+<booleanAttribute key="automaticValidate" value="false"/> > <stringAttribute key="bootstrap" value=""/> >-<booleanAttribute key="useProduct" value="false"/> >-<booleanAttribute key="tracing" value="true"/> >+<stringAttribute key="checked" value="[NONE]"/> >+<booleanAttribute key="clearConfig" value="true"/> >+<booleanAttribute key="clearws" value="true"/> >+<booleanAttribute key="clearwslog" value="false"/> >+<stringAttribute key="configLocation" value=""/> >+<booleanAttribute key="default" value="false"/> >+<booleanAttribute key="includeFragments" value="false"/> >+<booleanAttribute key="includeOptional" value="true"/> >+<stringAttribute key="location" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace2"/> >+<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/> >+<booleanAttribute key="maximized" value="false"/> >+<booleanAttribute key="onePlugin" value="false"/> >+<stringAttribute key="onePluginID" value=""/> >+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> >+<listEntry value="/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/AllTests.java"/> >+</listAttribute> >+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> >+<listEntry value="1"/> >+</listAttribute> >+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> > <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> > <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> > </listAttribute> > <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> >+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> >+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> >+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> >+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.AllTests"/> >+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os win32 -ws win32 -arch x86 -nl en_CA"/> >+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/> >+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> >+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/> >+<stringAttribute key="pde.version" value="3.3"/> >+<stringAttribute key="product" value="org.eclipse.platform.ide"/> >+<booleanAttribute key="run_in_ui_thread" value="true"/> >+<stringAttribute key="selected_target_plugins" value="org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default"/> >+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.compare.tests@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.tests.harness@default:default,org.eclipse.core.tests.resources@default:default,org.eclipse.jface@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.team.tests.core@default:default,org.eclipse.team.tests.cvs.core@default:default,org.eclipse.test.performance@default:default,workspace_loc@default:default"/> >+<booleanAttribute key="show_selected_only" value="false"/> >+<booleanAttribute key="tracing" value="true"/> > <mapAttribute key="tracingOptions"> >+<mapEntry key="org.eclipse.ant.core/buildfile/timing" value="false"/> >+<mapEntry key="org.eclipse.ant.core/debug" value="true"/> >+<mapEntry key="org.eclipse.core.boot/monitor/bundles" value="false"/> > <mapEntry key="org.eclipse.core.boot/monitor/classes" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ui/debug" value="false"/> >-<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/snapshots" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/loader" value="*"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/actions" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/timing/shutdown" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> >-<mapEntry key="org.eclipse.team.ftp/debug" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/> >+<mapEntry key="org.eclipse.core.boot/monitor/plugins" value="false"/> >+<mapEntry key="org.eclipse.core.boot/trace/classLoading" value="false"/> > <mapEntry key="org.eclipse.core.boot/trace/filename" value="runtime.traces"/> >+<mapEntry key="org.eclipse.core.boot/trace/filters" value="trace.properties"/> >+<mapEntry key="org.eclipse.core.boot/trace/pluginActivation" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> > <mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> >-<mapEntry key="org.eclipse.help/debug/search" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug" value="false"/> >-<mapEntry key="org.eclipse.team.ftp/requests" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug" value="false"/> >+<mapEntry key="org.eclipse.core.resources/debug" value="false"/> >+<mapEntry key="org.eclipse.core.resources/history" value="false"/> >+<mapEntry key="org.eclipse.core.resources/monitor/builders" value="false"/> > <mapEntry key="org.eclipse.core.resources/monitor/listeners" value="false"/> >-<mapEntry key="org.eclipse.ant.core/debug" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/pluginActivation" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug" value="true"/> >+<mapEntry key="org.eclipse.core.resources/natures" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/snapshots" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/config/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> > <mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug/ieadapter" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> >-<mapEntry key="org.eclipse.team.core/streams" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/classLoading" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/jobs" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/jobs/beginend" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/jobs/timing" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/actions" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/create" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/failure" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/class" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/loader" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/native" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/resource" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/failure" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/success" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/properties" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/success" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/preferences/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug" value="false"/> > <mapEntry key="org.eclipse.core.runtime/registry/debug/dump" value=""/> >-<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/restore" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/resolve" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> >-<mapEntry key="org.eclipse.core.boot/monitor/bundles" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/events/extension" value="false"/> > <mapEntry key="org.eclipse.core.runtime/registry/debug/events/plugin" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/part.activate" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/resolve" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/timing/shutdown" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/timing/startup" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> >+<mapEntry key="org.eclipse.debug.core/debug" value="true"/> >+<mapEntry key="org.eclipse.debug.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.help.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.help.ui/debug/ieadapter" value="false"/> > <mapEntry key="org.eclipse.help.ui/debug/ieadapter/inprocess" value="false"/> >-<mapEntry key="org.eclipse.jface/trace/actions" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/events/extension" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> >+<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> > <mapEntry key="org.eclipse.help.webapp/debug" value="true"/> >-<mapEntry key="org.eclipse.team.cvs.core/debug" value="true"/> >-<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> >-<mapEntry key="org.eclipse.ui/debug/internalerror/openDialog" value="false"/> >-<mapEntry key="org.eclipse.core.resources/debug" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/filters" value="trace.properties"/> >-<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> >-<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> >+<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/> >+<mapEntry key="org.eclipse.help/debug" value="true"/> > <mapEntry key="org.eclipse.help/debug/context" value="false"/> >+<mapEntry key="org.eclipse.help/debug/protocols" value="false"/> >+<mapEntry key="org.eclipse.help/debug/search" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> >+<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/resource" value="*"/> >-<mapEntry key="org.eclipse.team.ftp/list" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> >-<mapEntry key="org.eclipse.core.resources/monitor/builders" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/workbench.restore" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/part.create" value="false"/> >-<mapEntry key="org.eclipse.help/debug/protocols" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> >-<mapEntry key="org.eclipse.core.resources/natures" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/native" value="*"/> > <mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/properties" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/create" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/jobs/beginend" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> >-<mapEntry key="org.eclipse.team.ftp/responses" value="true"/> >+<mapEntry key="org.eclipse.jdt.debug.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.jdt.debug/debug" value="true"/> >+<mapEntry key="org.eclipse.jface/trace/actions" value="false"/> > <mapEntry key="org.eclipse.team.core/debug" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/success" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/jobs" value="false"/> >-<mapEntry key="org.eclipse.core.boot/monitor/plugins" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/workbench.start" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/timing/startup" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ui/consolebuffering" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/failure" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> >-<mapEntry key="org.eclipse.core.resources/history" value="false"/> > <mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> >-<mapEntry key="org.eclipse.ant.core/buildfile/timing" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> >-<mapEntry key="org.eclipse.jdt.debug.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.debug.core/debug" value="true"/> >-<mapEntry key="org.eclipse.help/debug" value="true"/> >-<mapEntry key="org.eclipse.ui/trace/perspective" value="false"/> >+<mapEntry key="org.eclipse.team.core/streams" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> >+<mapEntry key="org.eclipse.team.cvs.core/debug" value="true"/> >+<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ui/consolebuffering" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ui/debug" value="false"/> >+<mapEntry key="org.eclipse.team.ftp/debug" value="false"/> >+<mapEntry key="org.eclipse.team.ftp/list" value="true"/> >+<mapEntry key="org.eclipse.team.ftp/requests" value="true"/> >+<mapEntry key="org.eclipse.team.ftp/responses" value="true"/> > <mapEntry key="org.eclipse.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/config/debug" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> >-<mapEntry key="org.eclipse.debug.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.jdt.debug/debug" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> >+<mapEntry key="org.eclipse.ui/debug/internalerror/openDialog" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/part.activate" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/part.create" value="false"/> > <mapEntry key="org.eclipse.ui/trace/part.listeners" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/success" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/class" value="*"/> >-<mapEntry key="org.eclipse.core.runtime/preferences/debug" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/jobs/timing" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/failure" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/perspective" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/workbench.restore" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/workbench.start" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug" value="true"/> >+<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> > </mapAttribute> >-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> >-<booleanAttribute key="automaticAdd" value="true"/> >-<stringAttribute key="checked" value="[NONE]"/> >-<booleanAttribute key="includeFragments" value="false"/> >-<booleanAttribute key="clearws" value="true"/> >-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.AllTests"/> >-<stringAttribute key="location1" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/> >-<booleanAttribute key="default" value="false"/> >-<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/> >-<booleanAttribute key="clearConfig" value="true"/> >-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> >-<stringAttribute key="extplugins" value="org.eclipse.core.resources.compatibility;org.eclipse.jdt.doc.isv;org.eclipse.jdt.doc.user;org.eclipse.jdt.source;org.eclipse.pde.doc.user;org.eclipse.pde.source;org.eclipse.platform;org.eclipse.platform.source;org.eclipse.platform.source.win32.win32.x86;org.eclipse.sdk;"/> >-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> >-<booleanAttribute key="useDefaultConfigArea" value="true"/> >-<stringAttribute key="onePluginID" value=""/> >+<booleanAttribute key="useCustomFeatures" value="false"/> > <booleanAttribute key="useDefaultConfig" value="true"/> >-<stringAttribute key="progargs" value="-os win32 -ws win32 -arch x86 -nl en_CA"/> >-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> >-<stringAttribute key="wsproject" value="org.eclipse.pde.ui;"/> >-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/> >-<booleanAttribute key="askclear" value="false"/> >-<booleanAttribute key="onePlugin" value="false"/> >-<booleanAttribute key="includeOptional" value="true"/> >-<booleanAttribute key="maximized" value="false"/> >-<stringAttribute key="location0" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace2"/> >+<booleanAttribute key="useDefaultConfigArea" value="true"/> >+<booleanAttribute key="useProduct" value="false"/> > </launchConfiguration> >Index: launchConfigurations/CVS UI Tests.launch >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/launchConfigurations/CVS UI Tests.launch,v >retrieving revision 1.20 >diff -u -r1.20 CVS UI Tests.launch >--- launchConfigurations/CVS UI Tests.launch 25 Feb 2010 10:22:23 -0000 1.20 >+++ launchConfigurations/CVS UI Tests.launch 1 Dec 2011 15:01:06 -0000 >@@ -9,7 +9,7 @@ > <booleanAttribute key="clearws" value="true"/> > <booleanAttribute key="clearwslog" value="false"/> > <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/CVS UI Tests"/> >-<booleanAttribute key="default" value="true"/> >+<booleanAttribute key="default" value="false"/> > <booleanAttribute key="includeFragments" value="false"/> > <booleanAttribute key="includeOptional" value="true"/> > <stringAttribute key="location" value="C:\Eclipse\Latest-Eclipse-Drop\eclipse\runtime-test-workspace"/> >@@ -31,145 +31,148 @@ > <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> > <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> > <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> >+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_20"/> > <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.core.AllTests"/> > <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os win32 -ws win32 -arch x86 -nl en_CA"/> > <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.team.tests.cvs.core"/> > <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> >-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/> >+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.cvs.properties=g:\eclipse\repository.properties -Declipse.cvs.testName2=testFileAdditions"/> > <stringAttribute key="pde.version" value="3.3"/> > <stringAttribute key="product" value="org.eclipse.sdk.ide"/> > <booleanAttribute key="run_in_ui_thread" value="true"/> >+<stringAttribute key="selected_target_plugins" value="com.google.collect@default:default,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,org.antlr.runtime@default:default,org.aopalliance@default:default,org.apache.ant@default:default,org.apache.commons.cli@default:default,org.apache.commons.codec@default:default,org.apache.commons.el@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.jasper@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.lucene.highlighter@default:default,org.apache.lucene.memory@default:default,org.apache.lucene.misc@default:default,org.apache.lucene.queries@default:default,org.apache.lucene.snowball@default:default,org.apache.lucene.spellchecker@default:default,org.apache.lucene@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.launching@default:default,org.eclipse.ant.ui@default:default,org.eclipse.compare.core@default:default,org.eclipse.compare.win32@default:default,org.eclipse.compare@default:default,org.eclipse.core.boot@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.cvs@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.draw2d.doc.isv@default:default,org.eclipse.draw2d@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.converter@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.emf.mwe.activities@default:default,org.eclipse.emf.mwe.core@default:default,org.eclipse.emf.mwe.ui.simpleEditor@default:default,org.eclipse.emf.mwe.ui@default:default,org.eclipse.emf.mwe.utils@default:default,org.eclipse.emf.mwe2.language.ui@default:default,org.eclipse.emf.mwe2.language@default:default,org.eclipse.emf.mwe2.launch@default:default,org.eclipse.emf.mwe2.lib@default:default,org.eclipse.emf.mwe2.runtime@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.equinox.launcher.win32.win32.x86_64@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.p2.ui.importexport@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.gef.doc.isv@default:default,org.eclipse.gef.examples.flow@default:default,org.eclipse.gef.examples.logic@default:default,org.eclipse.gef.examples.shapes@default:default,org.eclipse.gef.examples.text@default:default,org.eclipse.gef.examples.ui.pde@default:default,org.eclipse.gef@default:default,org.eclipse.help.appserver@default:default,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help.webapp@default:default,org.eclipse.help@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.jdt.apt.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit4.runtime@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.eclipse.pde.api.tools.ui@default:default,org.eclipse.pde.api.tools@default:default,org.eclipse.pde.build@default:default,org.eclipse.pde.core@default:default,org.eclipse.pde.doc.user@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.pde.launching@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.pde.ui@default:default,org.eclipse.pde@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.platform@default:default,org.eclipse.rcp@default:default,org.eclipse.sdk@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.net@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.update.configurator@3:true,org.eclipse.update.core.win32@default:false,org.eclipse.update.core@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.update.ui@default:default,org.eclipse.xpand.activities@default:default,org.eclipse.xpand.ui@default:default,org.eclipse.xpand@default:default,org.eclipse.xtend.check.ui@default:default,org.eclipse.xtend.profiler@default:default,org.eclipse.xtend.shared.ui@default:default,org.eclipse.xtend.typesystem.emf.ui@default:default,org.eclipse.xtend.typesystem.emf@default:default,org.eclipse.xtend.ui@default:default,org.eclipse.xtend@default:default,org.eclipse.xtext.activities@default:default,org.eclipse.xtext.builder@default:default,org.eclipse.xtext.common.types.shared@default:default,org.eclipse.xtext.common.types.ui@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.doc@default:default,org.eclipse.xtext.ecore@default:default,org.eclipse.xtext.generator@default:default,org.eclipse.xtext.junit4@default:default,org.eclipse.xtext.junit@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.purexbase.ui@default:default,org.eclipse.xtext.purexbase@default:default,org.eclipse.xtext.ui.codetemplates.ui@default:default,org.eclipse.xtext.ui.codetemplates@default:default,org.eclipse.xtext.ui.ecore@default:default,org.eclipse.xtext.ui.junit@default:default,org.eclipse.xtext.ui.shared@default:default,org.eclipse.xtext.ui@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.junit@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase.ui@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext.xtend2.lib@default:default,org.eclipse.xtext.xtend2.ui@default:default,org.eclipse.xtext.xtend2@default:default,org.eclipse.xtext.xtext.ui.examples@default:default,org.eclipse.xtext.xtext.ui.graph@default:default,org.eclipse.xtext.xtext.ui@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.junit*4.8.2.v4_8_2_v20110321-1705@default:default,org.junit4@default:default,org.mortbay.jetty.server@default:default,org.mortbay.jetty.util@default:default,org.objectweb.asm@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default"/> >+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.compare.tests@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.tests.harness@default:default,org.eclipse.core.tests.resources@default:default,org.eclipse.jface@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.team.tests.core@default:default,org.eclipse.team.tests.cvs.core@default:default,org.eclipse.test.performance@default:default,workspace_loc@default:default"/> > <booleanAttribute key="show_selected_only" value="false"/> > <booleanAttribute key="tracing" value="true"/> > <mapAttribute key="tracingOptions"> >-<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> >-<mapEntry key="org.eclipse.team.ftp/requests" value="true"/> >-<mapEntry key="org.eclipse.core.resources/restore" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/workbench.restore" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/pluginActivation" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/native" value="*"/> >-<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/part.listeners" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug/ieadapter/inprocess" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/workbench.start" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug/ieadapter" value="false"/> >+<mapEntry key="org.eclipse.ant.core/buildfile/timing" value="false"/> > <mapEntry key="org.eclipse.ant.core/debug" value="true"/> >-<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> >-<mapEntry key="org.eclipse.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> >-<mapEntry key="org.eclipse.help/debug/protocols" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> >-<mapEntry key="org.eclipse.jface/trace/actions" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> >+<mapEntry key="org.eclipse.core.boot/monitor/bundles" value="false"/> >+<mapEntry key="org.eclipse.core.boot/monitor/classes" value="false"/> >+<mapEntry key="org.eclipse.core.boot/monitor/plugins" value="false"/> >+<mapEntry key="org.eclipse.core.boot/trace/classLoading" value="false"/> >+<mapEntry key="org.eclipse.core.boot/trace/filename" value="runtime.traces"/> >+<mapEntry key="org.eclipse.core.boot/trace/filters" value="trace.properties"/> >+<mapEntry key="org.eclipse.core.boot/trace/pluginActivation" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> >+<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> >+<mapEntry key="org.eclipse.core.resources/debug" value="false"/> >+<mapEntry key="org.eclipse.core.resources/history" value="false"/> >+<mapEntry key="org.eclipse.core.resources/monitor/builders" value="false"/> > <mapEntry key="org.eclipse.core.resources/monitor/listeners" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/part.activate" value="false"/> >+<mapEntry key="org.eclipse.core.resources/natures" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> >+<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> > <mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> >-<mapEntry key="org.eclipse.help/debug/context" value="false"/> >-<mapEntry key="org.eclipse.core.resources/monitor/builders" value="false"/> >-<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/events/plugin" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/success" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/snapshots" value="false"/> > <mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> >+<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/config/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/jobs" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/jobs/beginend" value="false"/> > <mapEntry key="org.eclipse.core.runtime/jobs/timing" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ui/debug" value="false"/> >-<mapEntry key="org.eclipse.team.core/debug" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/actions" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/create" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/failure" value="false"/> > <mapEntry key="org.eclipse.core.runtime/loader/debug/filter/class" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/loader" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/native" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/resource" value="*"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/failure" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/success" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/properties" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/loader/debug/success" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/preferences/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/dump" value=""/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/events/extension" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/events/plugin" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/registry/debug/resolve" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/timing/shutdown" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/timing/startup" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> >+<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> >+<mapEntry key="org.eclipse.debug.core/debug" value="true"/> > <mapEntry key="org.eclipse.debug.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/save" value="false"/> >-<mapEntry key="org.eclipse.jdt.debug/debug" value="true"/> >+<mapEntry key="org.eclipse.help.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.help.ui/debug/ieadapter" value="false"/> >+<mapEntry key="org.eclipse.help.ui/debug/ieadapter/inprocess" value="false"/> >+<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> >+<mapEntry key="org.eclipse.help.webapp/debug" value="true"/> >+<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/> >+<mapEntry key="org.eclipse.help/debug" value="true"/> >+<mapEntry key="org.eclipse.help/debug/context" value="false"/> >+<mapEntry key="org.eclipse.help/debug/protocols" value="false"/> >+<mapEntry key="org.eclipse.help/debug/search" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> > <mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/timing/shutdown" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/activateplugin" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/events/extension" value="false"/> >-<mapEntry key="org.eclipse.help.webapp/debug" value="true"/> >-<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> >-<mapEntry key="org.eclipse.team.ftp/responses" value="true"/> >-<mapEntry key="org.eclipse.team.ftp/debug" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/filename" value="runtime.traces"/> >-<mapEntry key="org.eclipse.ui/trace/part.create" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/loader" value="*"/> >-<mapEntry key="org.eclipse.ui/debug/internalerror/openDialog" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> >-<mapEntry key="org.eclipse.core.resources/natures" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/timing/startup" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/filters" value="trace.properties"/> >-<mapEntry key="org.eclipse.help/debug/search" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> >-<mapEntry key="org.eclipse.team.core/streams" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/failure" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/create" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> >-<mapEntry key="org.eclipse.core.resources/save/snapshots" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/filter/resource" value="*"/> >+<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> >+<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/> >-<mapEntry key="org.eclipse.ant.core/buildfile/timing" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/jobs/beginend" value="false"/> >-<mapEntry key="org.eclipse.core.boot/monitor/bundles" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug" value="false"/> >-<mapEntry key="org.eclipse.debug.core/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/debug" value="false"/> > <mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/properties" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> >+<mapEntry key="org.eclipse.jdt.debug.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.jdt.debug/debug" value="true"/> >+<mapEntry key="org.eclipse.jface/trace/actions" value="false"/> >+<mapEntry key="org.eclipse.team.core/debug" value="false"/> >+<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> >+<mapEntry key="org.eclipse.team.core/streams" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> > <mapEntry key="org.eclipse.team.cvs.core/debug" value="true"/> >-<mapEntry key="org.eclipse.help/debug" value="true"/> >-<mapEntry key="org.eclipse.team.ftp/list" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/resolve" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/success" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.ui/consolebuffering" value="false"/> >-<mapEntry key="org.eclipse.core.boot/monitor/plugins" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/preferences/debug" value="false"/> >-<mapEntry key="org.eclipse.update.core/debug" value="true"/> >-<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> > <mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/actions" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/registry/debug/dump" value=""/> >-<mapEntry key="org.eclipse.core.resources/history" value="false"/> >-<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/config/debug" value="false"/> >-<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> >-<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/debug" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes/failure" value="false"/> >-<mapEntry key="org.eclipse.core.boot/trace/classLoading" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> >-<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/> >-<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/loader/debug/prefixes" value="false"/> >-<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/> >-<mapEntry key="org.eclipse.core.boot/monitor/classes" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> >-<mapEntry key="org.eclipse.help.ui/debug" value="true"/> >-<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> >-<mapEntry key="org.eclipse.core.runtime/jobs" value="false"/> >-<mapEntry key="org.eclipse.jdt.debug.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ui/consolebuffering" value="false"/> >+<mapEntry key="org.eclipse.team.cvs.ui/debug" value="false"/> >+<mapEntry key="org.eclipse.team.ftp/debug" value="false"/> >+<mapEntry key="org.eclipse.team.ftp/list" value="true"/> >+<mapEntry key="org.eclipse.team.ftp/requests" value="true"/> >+<mapEntry key="org.eclipse.team.ftp/responses" value="true"/> >+<mapEntry key="org.eclipse.ui/debug" value="true"/> >+<mapEntry key="org.eclipse.ui/debug/internalerror/openDialog" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/part.activate" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/part.create" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/part.listeners" value="false"/> > <mapEntry key="org.eclipse.ui/trace/perspective" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/workbench.restore" value="false"/> >+<mapEntry key="org.eclipse.ui/trace/workbench.start" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug" value="true"/> >+<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> >+<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> > </mapAttribute> > <booleanAttribute key="useCustomFeatures" value="false"/> > <booleanAttribute key="useDefaultConfig" value="true"/> >Index: src/org/eclipse/team/tests/ccvs/core/EclipseTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java,v >retrieving revision 1.115 >diff -u -r1.115 EclipseTest.java >--- src/org/eclipse/team/tests/ccvs/core/EclipseTest.java 13 Feb 2011 00:43:21 -0000 1.115 >+++ src/org/eclipse/team/tests/ccvs/core/EclipseTest.java 1 Dec 2011 15:01:07 -0000 >@@ -19,6 +19,8 @@ > import java.io.PrintStream; > import java.io.Reader; > import java.lang.reflect.InvocationTargetException; >+import java.net.URI; >+import java.net.URISyntaxException; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.HashMap; >@@ -32,6 +34,7 @@ > > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IFolder; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IResourceVisitor; >@@ -807,6 +810,11 @@ > ignoredState, getCVSResource(resource).isIgnored()); > } > >+ protected void assertIsNotIgnored(IResource resource, boolean ignoredState) throws TeamException { >+ assertEquals("Resource " + resource.getFullPath() + " should be ignored but isn't.", >+ ignoredState, !getCVSResource(resource).isIgnored()); >+ } >+ > protected void assertValidCheckout(IProject project) { > // NOTE: Add code to ensure that the project was checkout out properly > CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project); >@@ -1468,4 +1476,27 @@ > //don't leak builder jobs, since they may affect subsequent tests > waitForBuild(); > } >+ >+ protected void createLink(IProject project, String name, IPath target) { >+ IPath relativeTarget = null; >+ try { >+ relativeTarget = new Path(project.getPathVariableManager().convertToRelative(new URI(target.toString()), true, null).getPath()); >+ } catch (CoreException e) { >+ fail("failure with convertToRelative(" + target + ")", e); >+ } catch (URISyntaxException e) { >+ fail("failure with convertToRelative(" + target + ")", e); >+ } >+ try { >+ if (name.endsWith("/")) { >+ name = name.substring(0, name.lastIndexOf('/')); >+ IFolder folder = project.getFolder(new Path(name)); >+ folder.createLink(relativeTarget, 0, getMonitor()); >+ } else { >+ IFile file = project.getFile(new Path(name)); >+ file.createLink(relativeTarget, 0, getMonitor()); >+ } >+ } catch (CoreException e) { >+ fail("failure with createLink(" + relativeTarget + ")", e); >+ } >+ } > } >Index: src/org/eclipse/team/tests/ccvs/core/provider/LinkResourcesTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/LinkResourcesTest.java,v >retrieving revision 1.11 >diff -u -r1.11 LinkResourcesTest.java >--- src/org/eclipse/team/tests/ccvs/core/provider/LinkResourcesTest.java 10 May 2006 18:10:44 -0000 1.11 >+++ src/org/eclipse/team/tests/ccvs/core/provider/LinkResourcesTest.java 1 Dec 2011 15:01:07 -0000 >@@ -15,6 +15,7 @@ > import junit.framework.Test; > import junit.framework.TestSuite; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IFolder; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -22,7 +23,9 @@ > import org.eclipse.team.core.RepositoryProvider; > import org.eclipse.team.core.TeamException; > import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; >+import org.eclipse.team.internal.ccvs.core.CVSTag; > import org.eclipse.team.internal.ccvs.core.ICVSFolder; >+import org.eclipse.team.internal.ccvs.core.ILogEntry; > import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; > import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer; > import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; >@@ -71,10 +74,10 @@ > IProject project = createProject("testLinkFailure", new String[] { "changed.txt", "deleted.txt", "folder1/", "folder1/a.txt" }); > IFolder folder = project.getFolder("link"); > folder.createLink(Platform.getLocation().append("temp"), IResource.ALLOW_MISSING_LOCAL, null); >- assertIsIgnored(folder, true); >+ assertIsNotIgnored(folder, true); > folder = project.getFolder("folder1/folder2/"); > folder.createLink(Platform.getLocation().append("temp"), IResource.ALLOW_MISSING_LOCAL, null); >- assertIsIgnored(folder, true); >+ assertIsNotIgnored(folder, true); > } > > public void testLinkCVSFolder() throws CoreException, TeamException, IOException { >@@ -86,4 +89,140 @@ > folder.createLink(source.getLocation(), 0, null); > assertEquals(sourceCopy, source); > } >+ /** >+ * Test a simple commit of a commit set with linked resource folder. The set being committed is not managed. >+ * @throws CoreException >+ * @throws IOException >+ * @throws TeamException >+ */ >+ public void testSimpleCommitLinkedResourceFolder() throws TeamException, CoreException, IOException { >+ IProject projectA = createProject(getName() + "_A", new String[] { "folder1/", "folder1/added.txt", "folder1/changed.txt", >+ "folder1/subfolder/", "folder1/subfolder/real_resource.txt",}); >+ IProject projectB = createProject(getName() + "_B", new String[] { "real_changed.txt", "real_deleted.txt"}); >+ >+ IPath target = projectA.getLocation(); >+ projectA.close(getMonitor()); >+ >+ createLink(projectB, "folder1/", target.append("folder1")); >+ >+ setContentsAndEnsureModified(projectB.getFile("real_changed.txt")); >+ setContentsAndEnsureModified(projectB.getFile("folder1/changed.txt")); >+ setContentsAndEnsureModified(projectB.getFile("folder1/subfolder/real_resource.txt")); >+ addResources(projectB, new String[] { "folder1/added.txt" }, false /* don't commit */); >+ >+ commitProject(projectB); >+ assertLocalStateEqualsRemote(projectB); >+ >+ projectA.open(getMonitor()); >+ projectA.refreshLocal(IResource.DEPTH_INFINITE, getMonitor()); >+ assertLocalStateEqualsRemote(projectA); >+ } >+ >+ /** >+ * Test a simple commit of a commit set with linked resource file. The set being committed is not managed. >+ * @throws CoreException >+ * @throws IOException >+ * @throws TeamException >+ */ >+ public void testSimpleCommitLinkedResourceFile() throws TeamException, CoreException, IOException { >+ IProject projectA = createProject(getName() + "_A", new String[] { "folder1/", "added.txt", "folder1/changed.txt"}); >+ IProject projectB = createProject(getName() + "_B", new String[] { "real_changed.txt", "real_deleted.txt", "folder2/"}); >+ >+ IPath target = projectA.getLocation(); >+ projectA.close(getMonitor()); >+ >+ createLink(projectB, "folder2/changed.txt", target.append("folder1/changed.txt")); >+ createLink(projectB, "added.txt", target.append("added.txt")); >+ >+ setContentsAndEnsureModified(projectB.getFile("real_changed.txt")); >+ setContentsAndEnsureModified(projectB.getFile("folder2/changed.txt")); >+ addResources(projectB, new String[] { "added.txt" }, false /* don't commit */); >+ >+ commitProject(projectB); >+ assertLocalStateEqualsRemote(projectB); >+ >+ projectA.open(getMonitor()); >+ projectA.refreshLocal(IResource.DEPTH_INFINITE, getMonitor()); >+ assertLocalStateEqualsRemote(projectA); >+ } >+ >+ public void testMakeBranchWithLinkedResources() throws TeamException, CoreException, IOException { >+ // Create a test project >+ IProject projectA = createProject(getName() + "_A", new String[] { "simple_link.txt", "folder1/", "folder1/added.txt", "folder1/changed.txt", >+ "folder1/subfolder/", "folder1/subfolder/real_resource.txt",}); >+ IProject projectB = createProject(getName() + "_B", new String[] { "real_changed.txt", "real_deleted.txt"}); >+ >+ IPath target = projectA.getLocation(); >+ projectA.close(getMonitor()); >+ >+ createLink(projectB, "folder1/", target.append("folder1")); >+ createLink(projectB, "folder1/subfolder/simple_link.txt", target.append("simple_link.txt")); >+ >+ // Make some local modifications including "cvs adds" and "cvs removes" >+ addResources(projectB, new String[] {"folder1/added.txt"}, false); >+ changeResources(projectB, new String[] {"folder1/changed.txt", "folder1/subfolder/simple_link.txt"}, false); >+ >+ // Make the branch including a pre-version >+ CVSTag version = new CVSTag("v1", CVSTag.BRANCH); >+ CVSTag branch = new CVSTag("branch1", CVSTag.BRANCH); >+ makeBranch(new IResource[] {projectB}, version, branch, true); >+ >+ // Checkout a copy from the branch and version and compare >+ IProject branchCopy = checkoutCopy(projectB, branch); >+ IProject versionCopy = checkoutCopy(projectB, version); >+ assertEquals(branchCopy, versionCopy, true, false); >+ >+ // Commit the project, update the branch and compare >+ commitProject(projectB); >+ updateProject(branchCopy, null, false); >+ assertEquals(branchCopy, projectB, false, true); >+ } >+ >+ public void testVersionTagWithLinkedResources() throws TeamException, CoreException, IOException { >+ >+ // Create a test project >+ IProject projectA = createProject(getName() + "_A", new String[] { "simple_link.txt", "folder1/", "folder1/added.txt", "folder1/changed.txt", >+ "folder1/subfolder/", "folder1/subfolder/real_resource.txt",}); >+ IProject projectB = createProject(getName() + "_B", new String[] { "real_changed.txt", "real_deleted.txt"}); >+ >+ IPath target = projectA.getLocation(); >+ projectA.close(getMonitor()); >+ >+ createLink(projectB, "folder1/", target.append("folder1")); >+ createLink(projectB, "folder1/subfolder/simple_link.txt", target.append("simple_link.txt")); >+ commitProject(projectB); >+ >+ // Perform some operations on the copy and commit >+ IProject copy = checkoutCopy(projectB, "-copy"); >+ addResources(copy, new String[] { "folder1/added.txt" }, false); >+ changeResources(copy, new String[] {"folder1/changed.txt", "folder1/subfolder/simple_link.txt"}, false); >+ commitResources(copy, true); >+ >+ // Tag the original, checkout the tag and compare with original >+ CVSTag v1Tag = new CVSTag("v1", CVSTag.VERSION); >+ tagProject(projectB, v1Tag, false); >+ >+ projectA.open(getMonitor()); >+ projectA.refreshLocal(IResource.DEPTH_INFINITE, getMonitor()); >+ assertFileContainsTag(projectA, "simple_link.txt", "v1"); >+ assertFileContainsTag(projectA, "folder1/added.txt", "v1"); >+ assertFileContainsTag(projectA, "folder1/changed.txt", "v1"); >+ } >+ >+ private void assertFileContainsTag(IProject projectA, String filePath, >+ String version) throws TeamException { >+ IFile file = projectA.getFile(Path.fromPortableString(filePath)); >+ ILogEntry[] entries = CVSWorkspaceRoot.getCVSFileFor(file).getLogEntries(getMonitor()); >+ assertTrue("tagged entry is not null", entries != null && (entries.length > 0)); >+ >+ boolean found = false; >+ for (int i = 0; i < entries.length; i++) { >+ CVSTag[] tags = entries[0].getTags(); >+ for (int j = 0; j < tags.length; j++) { >+ if (tags[j].getName().equals(version)) >+ found = true; >+ } >+ } >+ assertTrue("file is tagged", found); >+ } > } >Index: src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java,v >retrieving revision 1.9 >diff -u -r1.9 CommitSetTests.java >--- src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java 3 Apr 2006 14:35:25 -0000 1.9 >+++ src/org/eclipse/team/tests/ccvs/ui/CommitSetTests.java 1 Dec 2011 15:01:07 -0000 >@@ -16,14 +16,19 @@ > > import junit.framework.Test; > >-import org.eclipse.core.resources.*; >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.swt.widgets.Display; > import org.eclipse.team.core.TeamException; > import org.eclipse.team.internal.ccvs.core.CVSException; > import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; >-import org.eclipse.team.internal.core.subscribers.*; >+import org.eclipse.team.internal.core.subscribers.ActiveChangeSet; >+import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager; >+import org.eclipse.team.internal.core.subscribers.ChangeSet; >+import org.eclipse.team.internal.core.subscribers.IChangeSetChangeListener; > import org.eclipse.team.tests.ccvs.core.EclipseTest; > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41929
:
147046
|
174615
|
207795
|
208313