diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org')
45 files changed, 117 insertions, 1130 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java index 5c0271c2c..33f3cfee4 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSCompareSubscriber.java @@ -38,14 +38,14 @@ public class CVSCompareSubscriber extends CVSSyncTreeSubscriber implements ISubs private CVSResourceVariantTree tree; public CVSCompareSubscriber(IResource[] resources, CVSTag tag) { - super(getUniqueId(), Policy.bind("CVSCompareSubscriber.2", tag.getName()), Policy.bind("CVSCompareSubscriber.3")); //$NON-NLS-1$ //$NON-NLS-2$ + super(getUniqueId(), Policy.bind("CVSCompareSubscriber.2", tag.getName())); //$NON-NLS-1$ //$NON-NLS-2$ this.resources = resources; tree = new CVSResourceVariantTree(new SessionResourceVariantByteStore(), tag, getCacheFileContentsHint()); initialize(); } public CVSCompareSubscriber(IResource[] resources, CVSTag[] tags, String name) { - super(getUniqueId(), Policy.bind("CVSCompareSubscriber.2", name), Policy.bind("CVSCompareSubscriber.3")); //$NON-NLS-1$ //$NON-NLS-2$ + super(getUniqueId(), Policy.bind("CVSCompareSubscriber.2", name)); //$NON-NLS-1$ //$NON-NLS-2$ resetRoots(resources, tags); initialize(); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java index feb36dd55..348af4ee4 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java @@ -17,7 +17,6 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; import org.eclipse.team.core.TeamException; /** @@ -94,9 +93,4 @@ public class CVSException extends TeamException { } return new CVSException(e); } - - public CoreException toCoreException() { - IStatus status = getStatus(); - return new CoreException(new Status(status.getSeverity(), status.getPlugin(), 0, status.getMessage(), this)); - } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java index a41812fbc..f796d9517 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java @@ -126,7 +126,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour } public CVSMergeSubscriber(QualifiedName id, IResource[] roots, CVSTag start, CVSTag end) { - super(id, Policy.bind("CVSMergeSubscriber.2", start.getName(), end.getName()), Policy.bind("CVSMergeSubscriber.4")); //$NON-NLS-1$ //$NON-NLS-2$ + super(id, Policy.bind("CVSMergeSubscriber.2", start.getName(), end.getName())); //$NON-NLS-1$ //$NON-NLS-2$ this.start = start; this.end = end; this.roots = new ArrayList(Arrays.asList(roots)); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java index 300684259..e488a71c2 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java @@ -67,16 +67,12 @@ public class CVSProviderPlugin extends Plugin { private int communicationsTimeout = DEFAULT_TIMEOUT; private boolean pruneEmptyDirectories = DEFAULT_PRUNE; private boolean fetchAbsentDirectories = DEFAULT_FETCH; - private boolean promptOnFileDelete = true; - private boolean promptOnFolderDelete = true; private boolean replaceUnmanaged = true; private boolean repositoriesAreBinary = false; private String cvsRshCommand = DEFAULT_CVS_RSH; private String cvsRshParameters = DEFAULT_CVS_RSH_PARAMETERS; private String cvsServer = DEFAULT_CVS_SERVER; - private IConsoleListener consoleListener; private boolean determineVersionEnabled = true; - private boolean confirmMoveTagEnabled = true; private static volatile CVSProviderPlugin instance; @@ -110,27 +106,12 @@ public class CVSProviderPlugin extends Plugin { if (cvsWorkspaceSubscriber == null) { cvsWorkspaceSubscriber = new CVSWorkspaceSubscriber( CVS_WORKSPACE_SUBSCRIBER_ID, - Policy.bind("CVSProviderPlugin.20"), //$NON-NLS-1$ - Policy.bind("CVSProviderPlugin.21")); //$NON-NLS-1$ + Policy.bind("CVSProviderPlugin.20")); //$NON-NLS-1$ } return cvsWorkspaceSubscriber; } /** - * @return - */ - public boolean isConfirmMoveTagEnabled() { - return confirmMoveTagEnabled; - } - - /** - * @param confirmMoveTag - */ - public void setConfirmMoveTagEnabled(boolean confirmMoveTag) { - this.confirmMoveTagEnabled = confirmMoveTag; - } - - /** * Constructor for CVSProviderPlugin. * @param descriptor */ @@ -380,26 +361,10 @@ public class CVSProviderPlugin extends Plugin { this.fetchAbsentDirectories = fetchAbsentDirectories; } - public boolean getPromptOnFileDelete() { - return promptOnFileDelete; - } - - public void setPromptOnFileDelete(boolean prompt) { - promptOnFileDelete = prompt; - } - public void setRepositoriesAreBinary(boolean binary) { repositoriesAreBinary = binary; } - public boolean getPromptOnFolderDelete() { - return promptOnFolderDelete; - } - - public void setPromptOnFolderDelete(boolean prompt) { - promptOnFolderDelete = prompt; - } - public static void broadcastDecoratorEnablementChanged(final boolean enabled) { ICVSDecoratorEnablementListener[] listeners; synchronized(decoratorEnablementListeners) { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRevisionNumberCompareCriteria.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRevisionNumberCompareCriteria.java index e9f41ec9d..18e75e88f 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRevisionNumberCompareCriteria.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSRevisionNumberCompareCriteria.java @@ -27,18 +27,6 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; public CVSRevisionNumberCompareCriteria(boolean isThreeWay) { this.isThreeWay = isThreeWay; } - - /* (non-Javadoc) - * @see ComparisonCriteria#compare(Object, Object, IProgressMonitor) - */ - public boolean compare(Object e1, Object e2) { - if(e1 instanceof IResource && e2 instanceof ICVSRemoteResource) { - return compare((IResource)e1, (ICVSRemoteResource)e2); - } else if(e1 instanceof ICVSRemoteResource && e2 instanceof ICVSRemoteResource) { - return compare((ICVSRemoteResource)e1, (ICVSRemoteResource)e2); - } - return false; - } /** * @see RemoteSyncElement#timestampEquals(IResourceVariant, IResourceVariant) diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java index 96c2dae9d..931983b63 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java @@ -239,17 +239,6 @@ public class CVSSyncInfo extends SyncInfo { } /* - * Update the sync info of the local resource in such a way that the remote resource can be loaded - * ignore any local changes. - */ - public void makeIncoming(IProgressMonitor monitor) throws TeamException { - // To make outgoing deletions incoming, the local will not exist but - // it is still important to unmanage (e.g. delete all meta info) for the - // deletion. - CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage(monitor); - } - - /* * Load the resource and folder sync info into the local from the remote * * This method can be used on incoming folder additions to set the folder sync info properly @@ -323,7 +312,10 @@ public class CVSSyncInfo extends SyncInfo { // It is also impossible for an incomming folder to be static. FolderSyncInfo remoteInfo = remote.getFolderSyncInfo(); FolderSyncInfo localInfo = local.getParent().getFolderSyncInfo(); - local.setFolderSyncInfo(new FolderSyncInfo(remoteInfo.getRepository(), remoteInfo.getRoot(), localInfo.getTag(), false)); + MutableFolderSyncInfo newInfo = remoteInfo.cloneMutable(); + newInfo.setTag(localInfo.getTag()); + newInfo.setStatic(false); + local.setFolderSyncInfo(newInfo); return Status.OK_STATUS; } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java index cde80ee51..f715eb584 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncTreeSubscriber.java @@ -38,12 +38,10 @@ public abstract class CVSSyncTreeSubscriber extends ResourceVariantTreeSubscribe private QualifiedName id; private String name; - private String description; - CVSSyncTreeSubscriber(QualifiedName id, String name, String description) { + CVSSyncTreeSubscriber(QualifiedName id, String name) { this.id = id; this.name = name; - this.description = description; this.comparisonCriteria = new CVSRevisionNumberCompareCriteria(isThreeWay()); } @@ -62,13 +60,6 @@ public abstract class CVSSyncTreeSubscriber extends ResourceVariantTreeSubscribe } /* (non-Javadoc) - * @see org.eclipse.team.core.sync.ISyncTreeSubscriber#getDescription() - */ - public String getDescription() { - return description; - } - - /* (non-Javadoc) * @see org.eclipse.team.core.sync.ISyncTreeSubscriber#getSyncInfo(org.eclipse.core.resources.IResource) */ public SyncInfo getSyncInfo(IResource resource) throws TeamException { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java index 687b77f8a..dff4dd2c0 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java @@ -10,65 +10,28 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.core; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.io.*; +import java.util.*; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFileModificationValidator; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceRuleFactory; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.resources.*; import org.eclipse.core.resources.team.IMoveDeleteHook; import org.eclipse.core.resources.team.ResourceRuleFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.MultiRule; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.internal.ccvs.core.client.Command; -import org.eclipse.team.internal.ccvs.core.client.Commit; -import org.eclipse.team.internal.ccvs.core.client.Diff; -import org.eclipse.team.internal.ccvs.core.client.Session; +import org.eclipse.team.internal.ccvs.core.client.*; import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; -import org.eclipse.team.internal.ccvs.core.client.listeners.AdminKSubstListener; -import org.eclipse.team.internal.ccvs.core.client.listeners.DiffListener; -import org.eclipse.team.internal.ccvs.core.client.listeners.EditorsListener; -import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener; +import org.eclipse.team.internal.ccvs.core.client.listeners.*; 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.*; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; -import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; -import org.eclipse.team.internal.ccvs.core.util.Assert; -import org.eclipse.team.internal.ccvs.core.util.MoveDeleteHook; -import org.eclipse.team.internal.ccvs.core.util.ResourceStateChangeListeners; -import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; +import org.eclipse.team.internal.ccvs.core.util.*; import org.eclipse.team.internal.core.streams.CRLFtoLFInputStream; import org.eclipse.team.internal.core.streams.LFtoCRLFInputStream; @@ -390,14 +353,6 @@ public class CVSTeamProvider extends RepositoryProvider { } } - /* - * @see ITeamProvider#isDirty(IResource) - */ - public boolean isDirty(IResource resource) { - Assert.isTrue(false); - return false; - } - public CVSWorkspaceRoot getCVSWorkspaceRoot() { return workspaceRoot; } @@ -465,7 +420,9 @@ public class CVSTeamProvider extends RepositoryProvider { FolderSyncInfo info = folder.getFolderSyncInfo(); if (info != null) { monitor.subTask(Policy.bind("CVSTeamProvider.updatingFolder", info.getRepository())); //$NON-NLS-1$ - folder.setFolderSyncInfo(new FolderSyncInfo(info.getRepository(), root, info.getTag(), info.getIsStatic())); + MutableFolderSyncInfo newInfo = info.cloneMutable(); + newInfo.setRoot(root); + folder.setFolderSyncInfo(newInfo); folder.acceptChildren(this); } } @@ -675,17 +632,6 @@ public class CVSTeamProvider extends RepositoryProvider { } /* - * Marks a file as dirty. - */ - private static void makeDirty(IFile file) throws CVSException { - ICVSFile mFile = CVSWorkspaceRoot.getCVSFileFor(file); - ResourceSyncInfo origInfo = mFile.getSyncInfo(); - MutableResourceSyncInfo info = origInfo.cloneMutable(); - info.setTimeStamp(null);/*set the sync timestamp to null to trigger dirtyness*/ - mFile.setSyncInfo(info, ICVSFile.UNKNOWN); - } - - /* * @see RepositoryProvider#getID() */ public String getID() { @@ -698,13 +644,6 @@ public class CVSTeamProvider extends RepositoryProvider { public IMoveDeleteHook getMoveDeleteHook() { return moveDeleteHook; } - - /* - * Return the currently registered Move/Delete Hook - */ - public static MoveDeleteHook getRegisteredMoveDeleteHook() { - return moveDeleteHook; - } /** * @see org.eclipse.team.core.RepositoryProvider#getFileModificationValidator() diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java index faed856b4..7b66b18b4 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java @@ -54,8 +54,8 @@ public class CVSWorkspaceSubscriber extends CVSSyncTreeSubscriber implements IRe // qualified name for remote sync info private static final String REMOTE_RESOURCE_KEY = "remote-resource-key"; //$NON-NLS-1$ - CVSWorkspaceSubscriber(QualifiedName id, String name, String description) { - super(id, name, description); + CVSWorkspaceSubscriber(QualifiedName id, String name) { + super(id, name); // install sync info participant ResourceVariantByteStore baseSynchronizer = new CVSBaseResourceVariantTree(); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/DateUtil.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/DateUtil.java deleted file mode 100644 index 3a6a95d56..000000000 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/DateUtil.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 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; - - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; -import java.util.TimeZone; - -/** - * Utilities to handle time stamps in a cvs client. - */ -public class DateUtil { - - private static final String ENTRY_TIMESTAMP_FORMAT= "EEE MMM dd HH:mm:ss yyyy";//$NON-NLS-1$ - private static final String ENTRY_TIMESTAMP_TIME_ZONE= "GMT";//$NON-NLS-1$ - private static final Locale ENTRY_TIMESTAMP_LOCALE= Locale.US; - - private static final String MODTIME_TIMESTAMP_FORMAT= "dd MMM yyyy HH:mm:ss zz";//$NON-NLS-1$ - private static final Locale MODTIME_TIMESTAMP_LOCALE= Locale.US; - - /* - * A new format for log dates was introduced in 1.12.9 - */ - private static final String LOG_TIMESTAMP_FORMAT_OLD= "yyyy/MM/dd HH:mm:ss zzz";//$NON-NLS-1$ - private static final String LOG_TIMESTAMP_FORMAT= "yyyy-MM-dd HH:mm:ss zzz";//$NON-NLS-1$ - private static final Locale LOG_TIMESTAMP_LOCALE= Locale.US; - - private static final String HISTORY_TIMESTAMP_FORMAT= "yyyy-MM-dd HH:mm zzzz";//$NON-NLS-1$ - private static final Locale HISTORY_TIMESTAMP_LOCALE= Locale.US; - - /** - * Converts a time stamp as sent from a cvs server for a "log" command into a - * <code>Date</code>. - */ - public static Date convertFromLogTime(String modTime) { - String timestampFormat = LOG_TIMESTAMP_FORMAT; - // Compatibility for older cvs version (pre 1.12.9) - if (modTime.length() > 4 && modTime.charAt(4) == '/') - timestampFormat = LOG_TIMESTAMP_FORMAT_OLD; - - SimpleDateFormat format= new SimpleDateFormat(timestampFormat, - LOG_TIMESTAMP_LOCALE); - try { - return format.parse(modTime); - } catch (ParseException e) { - // fallback is to return null - return null; - } - } - /** - * Converts a modifcation time stamp as send from a cvs server into a - * <code>Date</code>. The format of the modification time stamp is defined - * in the document CVS Client/Server for CVS 1.11 section 5.6 Dates - */ - public static Date convertFromModTime(String modTime) { - SimpleDateFormat format= new SimpleDateFormat(MODTIME_TIMESTAMP_FORMAT, - MODTIME_TIMESTAMP_LOCALE); - try { - return format.parse(modTime); - } catch (ParseException e) { - // fallback is to return null - return null; - } - } - /** - * Converts a history time stamp as sent from a cvs server into a - * <code>Date</code>. - */ - public static Date convertFromHistoryTime(String historyTime) { - SimpleDateFormat format= new SimpleDateFormat(HISTORY_TIMESTAMP_FORMAT, - HISTORY_TIMESTAMP_LOCALE); - try { - return format.parse(historyTime); - } catch (ParseException e) { - // fallback is to return null - return null; - } - } - /** - * Converts a date into an entry time format as specified in the document - * Version Management with CVS for CVS 1.10.6 page 14. Note that the - * time format is always in GMT also not specified in the document. - */ - public static String toEntryFormat(Date date) { - SimpleDateFormat format= new SimpleDateFormat(ENTRY_TIMESTAMP_FORMAT, - ENTRY_TIMESTAMP_LOCALE); - format.setTimeZone(TimeZone.getTimeZone(ENTRY_TIMESTAMP_TIME_ZONE)); - return format.format(date); - } -} diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java index 73c97ea1a..f01649a69 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java @@ -120,13 +120,6 @@ public class Policy { return monitor; return new SubProgressMonitor(monitor, ticks); } - public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks, int style) { - if (monitor == null) - return new NullProgressMonitor(); - if (monitor instanceof NullProgressMonitor) - return monitor; - return new SubProgressMonitor(monitor, ticks, style); - } public static IProgressMonitor infiniteSubMonitorFor(IProgressMonitor monitor, int ticks) { if (monitor == null) diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java index 0fb7e3ca3..c8895f7c1 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java @@ -285,7 +285,4 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor { public boolean isRecurse() { return recurse; } - public void setRecurse(boolean recurse) { - this.recurse = recurse; - } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java index 0a51dec90..d2c724d91 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java @@ -21,6 +21,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSResource; import org.eclipse.team.internal.ccvs.core.Policy; import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; +import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo; import org.eclipse.team.internal.ccvs.core.util.Assert; public class Add extends Command { @@ -68,8 +69,10 @@ public class Add extends Command { if (info == null) { status = mergeStatus(status, new CVSStatus(CVSStatus.ERROR, Policy.bind("Add.invalidParent", mFolder.getRelativePath(session.getLocalRoot())))); //$NON-NLS-1$ } else { - String repository = info.getRepository() + "/" + mFolder.getName(); //$NON-NLS-1$ - mFolder.setFolderSyncInfo(new FolderSyncInfo(repository, info.getRoot(), info.getTag(), info.getIsStatic())); + String repository = info.getRepository() + "/" + mFolder.getName(); //$NON-NLS-1$ + MutableFolderSyncInfo newInfo = info.cloneMutable(); + newInfo.setRepository(repository); + mFolder.setFolderSyncInfo(newInfo); } } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java index 9a0492bed..76b5eebdf 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java @@ -20,11 +20,6 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListen public class Import extends Command { - /*** Local options: specific to import ***/ - public static LocalOption makeBinaryWrapperOption(String pattern) { - return new LocalOption("-W", pattern + " -k 'b'"); //$NON-NLS-1$ //$NON-NLS-2$ - } - protected Import() { } protected String getRequestId() { return "import"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java index 1c6daaae4..4a4f2807e 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java @@ -600,10 +600,6 @@ public class Session { * @param isBinary is true if the file should be sent without translation * @param monitor the progress monitor */ - public void sendFile(ICVSFile file, boolean isBinary, IProgressMonitor monitor) throws CVSException { - sendFile(file, isBinary, true, monitor); - } - public void sendFile(ICVSStorage file, boolean isBinary, boolean sendBinary, IProgressMonitor monitor) throws CVSException { // check overrides if (textTransferOverrideSet != null && diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java index 712fff665..4b26fa2f0 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java @@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.ICVSFolder; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; +import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo; import org.eclipse.team.internal.ccvs.core.util.Assert; /** @@ -61,8 +62,8 @@ class StaticHandler extends ResponseHandler { FolderSyncInfo syncInfo = folder.getFolderSyncInfo(); // Added to ignore sync info for workspace root if (syncInfo == null) return; - FolderSyncInfo newInfo = new FolderSyncInfo(syncInfo.getRepository(), - syncInfo.getRoot(), syncInfo.getTag(), setStaticDirectory); + MutableFolderSyncInfo newInfo = syncInfo.cloneMutable(); + newInfo.setStatic(setStaticDirectory); // only set the sync info if it has changed if (!syncInfo.equals(newInfo)) folder.setFolderSyncInfo(newInfo); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java index baba8e066..1154a839c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java @@ -16,6 +16,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.ICVSFolder; import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; +import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo; import org.eclipse.team.internal.ccvs.core.util.Assert; /** @@ -67,9 +68,8 @@ class StickyHandler extends ResponseHandler { FolderSyncInfo syncInfo = folder.getFolderSyncInfo(); // Added to ignore sync info for workspace root if (syncInfo == null) return; - FolderSyncInfo newInfo = new FolderSyncInfo(syncInfo.getRepository(), - syncInfo.getRoot(), tag != null ? new CVSEntryLineTag(tag) : null, - syncInfo.getIsStatic()); + MutableFolderSyncInfo newInfo = syncInfo.cloneMutable(); + newInfo.setTag(tag != null ? new CVSEntryLineTag(tag) : null); // only set the sync info if it has changed if (!syncInfo.equals(newInfo)) folder.setFolderSyncInfo(newInfo); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java index afe442b0d..5a8512ab1 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java @@ -84,22 +84,6 @@ public class Update extends Command { } /** - * Convenience method that allows the creation of .# files to be disabled. - * @param createBackups if true, creates .# files - * @see Command.execute - */ - public final IStatus execute(Session session, GlobalOption[] globalOptions, - LocalOption[] localOptions, String[] arguments, ICommandOutputListener listener, - IProgressMonitor pm, boolean createBackups) throws CVSException { - session.setCreateBackups(createBackups); - try { - return super.execute(session, globalOptions, localOptions, arguments, listener, pm); - } finally { - session.setCreateBackups(true); - } - } - - /** * On successful finish, prune empty directories if the -P or -D option was specified. */ protected IStatus commandFinished(Session session, GlobalOption[] globalOptions, diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java index 2f23ca971..cd000b894 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java @@ -122,7 +122,7 @@ public class UpdatedHandler extends ResponseHandler { // in the sync info. The os may not actually set the time we provided :) mFile.setTimeStamp(modTime); modTime = mFile.getTimeStamp(); - ResourceSyncInfo info = new ResourceSyncInfo(entryLine, null, null); + ResourceSyncInfo info = new ResourceSyncInfo(entryLine, null); MutableResourceSyncInfo newInfoWithTimestamp = info.cloneMutable(); newInfoWithTimestamp.setTimeStamp(modTime); int modificationState = ICVSFile.UNKNOWN; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java index 1f5994f84..44e13b7a3 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java @@ -18,7 +18,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener; -import org.eclipse.team.internal.ccvs.core.Policy; public class AnnotateListener extends CommandOutputListener { @@ -28,14 +27,9 @@ public class AnnotateListener extends CommandOutputListener { ByteArrayOutputStream aStream = new ByteArrayOutputStream(); List blocks = new ArrayList(); int lineNumber; - String error; - - public String getError() { - return error; - } public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) { - + String error = null; CVSAnnotateBlock aBlock = new CVSAnnotateBlock(line, lineNumber++); if (!aBlock.isValid()) { error = line; @@ -52,6 +46,8 @@ public class AnnotateListener extends CommandOutputListener { } catch (IOException e) { } add(aBlock); + if (error != null) + return new CVSStatus(CVSStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, commandRoot, error); return OK; } @@ -82,16 +78,12 @@ public class AnnotateListener extends CommandOutputListener { } } - public boolean hasError() { - return (error != null); - } - /* (non-Javadoc) * @see org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener#errorLine(java.lang.String, org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation, org.eclipse.team.internal.ccvs.core.ICVSFolder, org.eclipse.core.runtime.IProgressMonitor) */ public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) { if(line.startsWith(Policy.bind("AnnotateListener.3"))) { //$NON-NLS-1$ - error = Policy.bind("AnnotateListener.4"); //$NON-NLS-1$ + String error = Policy.bind("AnnotateListener.4"); //$NON-NLS-1$ return new CVSStatus(CVSStatus.ERROR, CVSStatus.SERVER_ERROR, commandRoot, error); } return super.errorLine(line, location, commandRoot, monitor); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/CompareDiffListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/CompareDiffListener.java deleted file mode 100644 index 9122882d1..000000000 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/CompareDiffListener.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 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.client.listeners; - -import java.util.Map; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; -import org.eclipse.team.internal.ccvs.core.CVSStatus; -import org.eclipse.team.internal.ccvs.core.ICVSFolder; -import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; -import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener; -import org.eclipse.team.internal.ccvs.core.Policy; - -/** - * This class interprets the output of "cvs diff --brief ..." in order to get the revisions - * of two compared versions of a project or folder. - */ -public class CompareDiffListener extends CommandOutputListener { - - private static ServerMessageLineMatcher LOCAL_FILE_MATCHER; - private static ServerMessageLineMatcher REMOTE_FILE_MATCHER; - private static ServerMessageLineMatcher REVISION_LINE_MATCHER; - - static { - try { - LOCAL_FILE_MATCHER = new ServerMessageLineMatcher( - "Index: (localFile:.*:localFile)", new String[] {"localFile"}); //$NON-NLS-1$ //$NON-NLS-2$ - REMOTE_FILE_MATCHER = new ServerMessageLineMatcher( - "RCS file: (remoteFile:.*:remoteFile),v", new String[] {"remoteFile"}); //$NON-NLS-1$ //$NON-NLS-2$ - REVISION_LINE_MATCHER = new ServerMessageLineMatcher( - "diff .* -r(leftRevision:.*:leftRevision) -r(rightRevision:.*:rightRevision)", new String[] {"leftRevision", "rightRevision"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } catch (CVSException e) { - // This is serious as the listener will not function properly - CVSProviderPlugin.log(e); - LOCAL_FILE_MATCHER = null; - REMOTE_FILE_MATCHER = null; - REVISION_LINE_MATCHER = null; - } - } - - private String localFilePath, remoteFilePath, leftRevision, rightRevision; - - private IFileDiffListener listener; - - public interface IFileDiffListener { - public void fileDiff( - String localFilePath, - String remoteFilePath, - String leftRevision, - String rightRevision); - } - - public CompareDiffListener(IFileDiffListener listener) { - this.listener = listener; - } - - public IStatus messageLine( - String line, - ICVSRepositoryLocation location, - ICVSFolder commandRoot, - IProgressMonitor monitor) { - // ignore any server messages - if (getServerMessage(line, location) != null) { - return OK; - } - Map map = LOCAL_FILE_MATCHER.processServerMessage(line); - if (map != null) { - localFilePath = (String)map.get("localFile"); //$NON-NLS-1$ - return OK; - } - map = REMOTE_FILE_MATCHER.processServerMessage(line); - if (map != null) { - remoteFilePath = (String)map.get("remoteFile"); //$NON-NLS-1$ - return OK; - } - map = REVISION_LINE_MATCHER.processServerMessage(line); - if (map != null) { - leftRevision = (String)map.get("leftRevision"); //$NON-NLS-1$ - rightRevision = (String)map.get("rightRevision"); //$NON-NLS-1$ - if (localFilePath == null || remoteFilePath == null) { - return new CVSStatus(IStatus.ERROR, Policy.bind("CompareDiffListener.11")); //$NON-NLS-1$ - } - listener.fileDiff(localFilePath, remoteFilePath, leftRevision, rightRevision); - localFilePath = remoteFilePath = leftRevision = rightRevision = null; - return OK; - } - // Ignore all other lines - return OK; - } - - public IStatus errorLine( - String line, - ICVSRepositoryLocation location, - ICVSFolder commandRoot, - IProgressMonitor monitor) { - // ignore server messages for now - this is used only with the diff - // request and the errors can be safely ignored. - if (getServerMessage(line, location) != null) { - return OK; - } - return super.errorLine(line, location, commandRoot, monitor); - } - -} diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java index 6d9ab027c..610c41bc8 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.core.client.listeners; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; @@ -25,6 +27,13 @@ import org.eclipse.team.internal.ccvs.core.util.Util; */ public class LogListener extends CommandOutputListener { + /* + * A new format for log dates was introduced in 1.12.9 + */ + private static final String LOG_TIMESTAMP_FORMAT_OLD= "yyyy/MM/dd HH:mm:ss zzz";//$NON-NLS-1$ + private static final String LOG_TIMESTAMP_FORMAT= "yyyy-MM-dd HH:mm:ss zzz";//$NON-NLS-1$ + private static final Locale LOG_TIMESTAMP_LOCALE= Locale.US; + // Server message prefix used for error detection private static final String NOTHING_KNOWN_ABOUT = "nothing known about "; //$NON-NLS-1$ @@ -177,7 +186,7 @@ public class LogListener extends CommandOutputListener { thisRevisionTags.add(new CVSTag(tagName, type)); } } - Date date = DateUtil.convertFromLogTime(creationDate); + Date date = convertFromLogTime(creationDate); if (currentFile != null) { LogEntry entry = new LogEntry(currentFile, revision, author, date, comment.toString(), fileState, (CVSTag[]) thisRevisionTags.toArray(new CVSTag[0])); @@ -222,5 +231,24 @@ public class LogListener extends CommandOutputListener { if (tagName.charAt(lastDot - 1) == '0' && tagName.charAt(lastDot - 2) == '.') return true; return false; } - + + /** + * Converts a time stamp as sent from a cvs server for a "log" command into a + * <code>Date</code>. + */ + private Date convertFromLogTime(String modTime) { + String timestampFormat = LOG_TIMESTAMP_FORMAT; + // Compatibility for older cvs version (pre 1.12.9) + if (modTime.length() > 4 && modTime.charAt(4) == '/') + timestampFormat = LOG_TIMESTAMP_FORMAT_OLD; + + SimpleDateFormat format= new SimpleDateFormat(timestampFormat, + LOG_TIMESTAMP_LOCALE); + try { + return format.parse(modTime); + } catch (ParseException e) { + // fallback is to return null + return null; + } + } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleExpansion.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleExpansion.java deleted file mode 100644 index fdb835000..000000000 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleExpansion.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 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.client.listeners; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.Policy; -import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; - -/** - * - */ -public class ModuleExpansion { - - /** Name of the CVS module as found in the CVSROOT/modules file */ - private String moduleName; - - /** Expansion of the module name returned by the CVS server */ - private String[] expansions; - - private LocalOption[] options; - - ModuleExpansion(String moduleName, String[] expansions, LocalOption[] options) { - this.moduleName = moduleName; - this.expansions = expansions; - this.options = options; - } - - /** - * @see IModuleExpansion#getModuleName() - */ - public String getModuleName() { - return moduleName; - } - - /** - * @see IModuleExpansion#getModuleExpansionString() - */ - public String getModuleExpansionString() { - String result = expansions[0]; - for (int i=1;i<expansions.length; i++) - result = result + ", " + expansions[i]; //$NON-NLS-1$ - return result; - } - - /** - * @see IModuleExpansion#getExpansions() - */ - public String[] getExpansions() { - return expansions; - } - - public LocalOption[] getOptions() { - return options; - } - - /** - * Translate an array of module names to their expansions. - * The resulting List of Strings may be bigger than the original - */ - private List getExpansionsFor(String[] possibleModules, Map moduleMappings, int depth) throws CVSException { - List result = new ArrayList(); - for (int i=0;i<possibleModules.length;i++) { - // Is it a module? - if (possibleModules[i].charAt(0) == '&') - result.addAll(getExpansionsFor(possibleModules[i].substring(1), moduleMappings, depth)); - else - result.add(possibleModules[i]); - } - return result; - } - - /** - * Translate a module name to its expansion. - * The resulting List may contain one or more Strings - */ - private List getExpansionsFor(String module, Map moduleMappings, int depth) throws CVSException { - if (depth > moduleMappings.size()) { - // Indicate that a circular reference exists - throw new CVSException(Policy.bind("ModuleExpansion.circular", module));//$NON-NLS-1$ - } - Object mappings = moduleMappings.get(module); - if (mappings == null) { - // If there's no mapping assume it is a project name - List result = new ArrayList(); - result.add(module); - return result; - } else { - // Follow any expansion chains - return getExpansionsFor(((ModuleExpansion)mappings).expansions, moduleMappings, depth + 1); - } - } - - /** - * Resolve the module mappings using moduleMappings which maps - * module names to their ModuleExpansion - */ - public void resolveModuleReferencesUsing(Map moduleMappings) { - try { - List result = getExpansionsFor(expansions, moduleMappings, 0); - expansions = (String[])result.toArray(new String[result.size()]); - } catch (CVSException e) { - // Is this the best way to show the circular reference problem? - // Or should we just leave the expansions untouched? - List result = new ArrayList(); - result.add(e.getStatus().getMessage()); - result.addAll(Arrays.asList(expansions)); - expansions = (String[])result.toArray(new String[result.size()]); - } - } -} - - diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java index 2755b2518..67e1c8d47 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ServerMessageLineMatcher.java @@ -91,9 +91,4 @@ public class ServerMessageLineMatcher { return result; } - public boolean matches(String line) { - Matcher matcher = pattern.matcher(line); - return (matcher.find()); - } - } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java index bf50a2646..0abbebf01 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java @@ -174,23 +174,6 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit } /** - * Validate whether the given string is a valid registered connection method - * name. - * @param methodName the method name - * @return whether the given string is a valid registered connection method - * name - */ - public static boolean validateConnectionMethod(String methodName) { - Assert.isNotNull(methodName); - IConnectionMethod[] methods = getPluggedInConnectionMethods(); - for (int i=0;i<methods.length;i++) { - if (methodName.equals(methods[i].getName())) - return true; - } - return false; - } - - /** * Create a repository location instance from the given properties. * The supported properties are: * @@ -380,59 +363,6 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit } /** - * Validate that the given string could be used to succesfully create - * a CVS repository location - * - * This method performs some initial checks to provide displayable - * feedback and also tries a more in-depth parse using - * <code>fromString(String, boolean)</code>. - */ - public static IStatus validate(String location) { - - // Check some simple things that are not checked in creation - if (location == null) - return new CVSStatus(IStatus.ERROR, Policy.bind("CVSRepositoryLocation.nullLocation"));//$NON-NLS-1$ - if (location.equals(""))//$NON-NLS-1$ - return new CVSStatus(IStatus.ERROR, Policy.bind("CVSRepositoryLocation.emptyLocation"));//$NON-NLS-1$ - if (location.endsWith(" ") || location.endsWith("\t"))//$NON-NLS-1$ //$NON-NLS-2$ - return new CVSStatus(IStatus.ERROR, Policy.bind("CVSRepositoryLocation.endWhitespace"));//$NON-NLS-1$ - if (!location.startsWith(":") || location.indexOf(COLON, 1) == -1)//$NON-NLS-1$ - return new CVSStatus(IStatus.ERROR, Policy.bind("CVSRepositoryLocation.startOfLocation"));//$NON-NLS-1$ - - // Do some quick checks to provide geberal feedback - String formatError = Policy.bind("CVSRepositoryLocation.locationForm");//$NON-NLS-1$ - int secondColon = location.indexOf(COLON, 1); - int at = location.indexOf(HOST_SEPARATOR); - if (at != -1) { - String user = location.substring(secondColon + 1, at); - if (user.equals(""))//$NON-NLS-1$ - return new CVSStatus(IStatus.ERROR, formatError); - } else - at = secondColon; - int colon = location.indexOf(COLON, at + 1); - if (colon == -1) - return new CVSStatus(IStatus.ERROR, formatError); - String host = location.substring(at + 1, colon); - if (host.equals(""))//$NON-NLS-1$ - return new CVSStatus(IStatus.ERROR, formatError); - String path = location.substring(colon + 1, location.length()); - if (path.equals(""))//$NON-NLS-1$ - return new CVSStatus(IStatus.ERROR, formatError); - - // Do a full parse and see if it passes - try { - fromString(location, true); - } catch (CVSException e) { - // An exception is always throw. Return the status - return e.getStatus(); - } - - // Looks ok (we'll actually never get here because above - // fromString(String, boolean) will always throw an exception). - return Status.OK_STATUS; - } - - /** * Get the plugged-in user authenticator if there is one. * @return the plugged-in user authenticator or <code>null</code> */ @@ -628,14 +558,6 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit public IConnectionMethod getMethod() { return method; } - - public boolean setMethod(String methodName) { - IConnectionMethod newMethod = getPluggedInConnectionMethod(methodName); - if (newMethod == null) - return false; - method = newMethod; - return true; - } /* * @see ICVSRepositoryLocation#getPort() @@ -955,10 +877,6 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit this.password = password; } - public void setUserInfo(IUserInfo userinfo) { - user = userinfo.getUsername(); - password = ((UserInfo)userinfo).getPassword(); - } /* * @see IUserInfo#setUsername(String) */ diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java index ddf87e422..4eefa5758 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSServerException.java @@ -14,7 +14,6 @@ package org.eclipse.team.internal.ccvs.core.connection; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; import org.eclipse.team.internal.ccvs.core.CVSStatus; /** @@ -56,24 +55,7 @@ public class CVSServerException extends CVSException { return false; } - /** - * Return the CVSServerException for the given error message and error list - * - * This is public due to packaging and should not be used by clients. - */ - public static CVSServerException forError(String message, IStatus[] children) { - if (children.length > 0) { - return new CVSServerException(message, children); - } else { - return new CVSServerException(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, message, null)); - } - } - public CVSServerException(IStatus status) { super(status); } - - private CVSServerException(String message, IStatus[] children) { - super(new MultiStatus(CVSProviderPlugin.ID, CVSStatus.SERVER_ERROR, children, message, null)); - } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java index 2eb0d1f81..24d4888af 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java @@ -10,31 +10,12 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.core.resources; -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.ResourcesPlugin; +import org.eclipse.core.resources.*; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; -import org.eclipse.team.internal.ccvs.core.CVSStatus; -import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.core.ICVSFile; -import org.eclipse.team.internal.ccvs.core.ICVSFolder; -import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; -import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource; -import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; -import org.eclipse.team.internal.ccvs.core.ICVSResource; -import org.eclipse.team.internal.ccvs.core.Policy; -import org.eclipse.team.internal.ccvs.core.client.Request; -import org.eclipse.team.internal.ccvs.core.client.Session; +import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; -import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; 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.KnownRepositories; @@ -78,45 +59,7 @@ public class CVSWorkspaceRoot { // Register the project with Team RepositoryProvider.map(project, CVSProviderPlugin.getTypeId()); } - - /** - * Answer the list of directories that a checkout of the given resources would expand to. - * In other words, the returned strings represent the root paths that the given resources would - * be loaded into. - */ - public static String[] getExpansions(ICVSRemoteFolder[] resources, IProgressMonitor monitor) throws CVSException { - - if (resources.length == 0) return new String[0]; - - // Get the location of the workspace root - ICVSFolder root = CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()); - - // Get the command arguments - String[] arguments = new String[resources.length]; - for (int i = 0; i < resources.length; i++) { - if (resources[i] instanceof RemoteModule) { - arguments[i] = ((RemoteModule)resources[i]).getName(); - } else { - arguments[i] = resources[i].getRepositoryRelativePath(); - } - } - - // Perform the Expand-Modules command - IStatus status; - Session s = new Session(resources[0].getRepository(), root); - s.open(monitor, false /* read-only */); - try { - status = Request.EXPAND_MODULES.execute(s, arguments, monitor); - } finally { - s.close(); - } - if (status.getCode() == CVSStatus.SERVER_ERROR) { - throw new CVSServerException(status); - } - - return s.getModuleExpansions(); - } - + public static ICVSFolder getCVSFolderFor(IContainer resource) { return new EclipseFolder(resource); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java index b5e3b07a8..94c7d579d 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java @@ -481,7 +481,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile { // (modified = false) the file will be no longer modified } else if (oldInfo == null) { // cvs add: addition of a file - newInfo = new ResourceSyncInfo(entryLine, null, null); + newInfo = new ResourceSyncInfo(entryLine, null); // an added file should show up as modified modificationState = ICVSFile.DIRTY; } else { @@ -500,7 +500,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile { setTimeStamp(timeStamp); } } - newInfo = new ResourceSyncInfo(entryLine, oldInfo.getPermissions(), timeStamp); + newInfo = new ResourceSyncInfo(entryLine, timeStamp); } if (newInfo != null) setSyncInfo(newInfo, modificationState); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java index 30592ef0f..c14956cc2 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java @@ -1408,17 +1408,6 @@ public class EclipseSynchronizer implements IFlushOperation { } /** - * This method is invoked from the IMoveDeleteHook to batch the resulting sync file - * changes. - */ - public void run(ICVSRunnable runnable, IProgressMonitor monitor) throws CVSException { - // Use the root resource as the rule. - // Note: This will not lock the workspace due to behavior in ReentrantLock - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - run(root, runnable, monitor); - } - - /** * 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 @@ -1506,16 +1495,6 @@ public class EclipseSynchronizer implements IFlushOperation { private byte[] convertToDeletion(byte[] syncBytes) throws CVSException { return ResourceSyncInfo.convertToDeletion(syncBytes); } - - /** - * Method createdByMove clears any session properties on the file so it - * appears as an ADDED file. - * - * @param destination - */ - public void createdByMove(IFile file) throws CVSException { - deleteResourceSync(file); - } static public void debug(IResource resource, String indicator, String string) { String di = EclipseSynchronizer.IS_DIRTY_INDICATOR; @@ -1528,10 +1507,6 @@ public class EclipseSynchronizer implements IFlushOperation { } System.out.println("["+string + ":" + di + "] " + resource.getFullPath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } - - static public void debug(IResource resource, boolean modified, String string) { - debug(resource, modified ? IS_DIRTY_INDICATOR : NOT_DIRTY_INDICATOR, string); - } /** * @param file diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java index bb6c74b65..4ab2d9456 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java @@ -582,28 +582,12 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile { } /* (non-Javadoc) - * @see org.eclipse.team.core.sync.IRemoteResource#getComment() - */ - public String getComment() throws CVSException { - ILogEntry entry = getLogEntry(new NullProgressMonitor()); - return entry.getComment(); - } - - /* (non-Javadoc) * @see org.eclipse.team.core.sync.IRemoteResource#getContentIdentifier() */ public String getContentIdentifier() { return getRevision(); } - /* (non-Javadoc) - * @see org.eclipse.team.core.sync.IRemoteResource#getCreatorDisplayName() - */ - public String getCreatorDisplayName() throws CVSException { - ILogEntry entry = getLogEntry(new NullProgressMonitor()); - return entry.getAuthor(); - } - /** * Callback which indicates that the remote file is about to receive contents that should be cached * @param entryLine diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java index 01f502ffb..601080a02 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java @@ -11,7 +11,6 @@ package org.eclipse.team.internal.ccvs.core.resources; -import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -25,11 +24,10 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener; import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener; import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; +import org.eclipse.team.internal.ccvs.core.syncinfo.*; 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.*; -import org.eclipse.team.internal.ccvs.core.util.Assert; -import org.eclipse.team.internal.ccvs.core.util.Util; /** * This class provides the implementation of ICVSRemoteFolder @@ -416,13 +414,6 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC } /* - * @see IRemoteResource#getContents(IProgressMonitor) - */ - public InputStream getContents(IProgressMonitor progress) { - return null; - } - - /* * Answers the immediate cached children of this remote folder or null if the remote folder * handle has not yet queried the server for the its children. */ @@ -439,7 +430,9 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC * @see ICVSRemoteFolder#setTag(String) */ public void setTag(CVSTag tag) { - this.folderInfo = new FolderSyncInfo(folderInfo.getRepository(), folderInfo.getRoot(), tag, folderInfo.getIsStatic()); + MutableFolderSyncInfo newInfo = folderInfo.cloneMutable(); + newInfo.setTag(tag); + setFolderSyncInfo(newInfo); } /* @@ -452,8 +445,8 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC /* * @see ICVSFolder#setFolderInfo(FolderSyncInfo) */ - public void setFolderSyncInfo(FolderSyncInfo folderInfo) throws CVSException { - this.folderInfo = folderInfo; + public void setFolderSyncInfo(FolderSyncInfo folderInfo) { + this.folderInfo = folderInfo.asImmutable(); } /* @@ -464,13 +457,6 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC } /* - * @see ICVSFolder#run(ICVSRunnable, int, IProgressMonitor) - */ - public void run(ICVSRunnable job, int flags, IProgressMonitor monitor) throws CVSException { - job.run(monitor); - } - - /* * @see ICVSFolder#tag(CVSTag, LocalOption[], IProgressMonitor) */ public IStatus tag(final CVSTag tag, final LocalOption[] localOptions, IProgressMonitor monitor) throws CVSException { @@ -578,25 +564,11 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC } /* (non-Javadoc) - * @see org.eclipse.team.core.sync.IRemoteResource#getComment() - */ - public String getComment() { - return null; - } - - /* (non-Javadoc) * @see org.eclipse.team.core.sync.IRemoteResource#getContentIdentifier() */ public String getContentIdentifier() { return getTag().getName(); } - - /* (non-Javadoc) - * @see org.eclipse.team.core.sync.IRemoteResource#getCreatorDisplayName() - */ - public String getCreatorDisplayName() { - return null; - } /* (non-Javadoc) * @see org.eclipse.team.internal.ccvs.core.ICVSResource#isManaged() diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java index 2c3381249..1b5d13cba 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java @@ -141,17 +141,6 @@ public class RemoteFolderTreeBuilder { RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, file.getParent(), tag); return builder.buildTree(file, monitor); } - - /* - * The provided resources must all be children of the same project - */ - public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, ICVSFolder root, ICVSResource[] resources, CVSTag tag, IProgressMonitor monitor) throws CVSException { - if (resources.length == 0) { - resources = new ICVSResource[] { root }; - } - RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag); - return builder.buildTree(resources, monitor); - } /* package */ RemoteFolderTree buildTree(ICVSResource[] resources, IProgressMonitor monitor) throws CVSException { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java index 3c6b2068b..68bd0c9a7 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java @@ -142,14 +142,6 @@ public abstract class RemoteResource extends CachedResourceVariant implements IC */ public abstract ResourceSyncInfo getSyncInfo(); - /* - * @see ICVSResource#setSyncInfo(ResourceSyncInfo) - */ - public void setSyncInfo(ResourceSyncInfo info, int modificationState) { - // ensure that clients are not trying to set sync info on remote handles. - Assert.isTrue(false); - } - public boolean equals(Object target) { if (this == target) return true; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java index 12bedded7..c0dbe9445 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java @@ -364,16 +364,6 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; synchronizerCache.setCachedSyncBytes(resource, null, canModifyWorkspace); } } - - /* (non-Javadoc) - * @see org.eclipse.team.internal.ccvs.core.resources.SyncInfoCache#isDirtyCacheFlushed(org.eclipse.core.resources.IContainer) - */ - boolean isDirtyCacheFlushed(IContainer resource) throws CVSException { - if (resource.exists()) { - return getDirtyIndicator(resource) == RECOMPUTE_INDICATOR; - } - return false; - } /* (non-Javadoc) * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext) diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SyncInfoCache.java index a8c8b97b2..f6302bf40 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SyncInfoCache.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SyncInfoCache.java @@ -136,12 +136,6 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; /*package*/ abstract void setResourceSyncInfoCached(IContainer container) throws CVSException; /** - * @param resource - * @return boolean - */ - /*package*/ abstract boolean isDirtyCacheFlushed(IContainer resource) throws CVSException; - - /** * Return whether the cache also caches dirty state or recomputes it * each time it is requested. */ diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java index dd71583ba..0fe22424d 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java @@ -263,13 +263,6 @@ import org.eclipse.team.internal.ccvs.core.util.Util; return true; } - /* (non-Javadoc) - * @see org.eclipse.team.internal.ccvs.core.resources.SyncInfoCache#isDirtyCacheFlushed(org.eclipse.core.resources.IContainer) - */ - boolean isDirtyCacheFlushed(IContainer resource) throws CVSException { - return false; - } - /* * Calculate the dirty count for the given phantom folder, performing any * necessary calculations on the childen as well diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java index 110dce3ae..0987f6bb1 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java @@ -172,7 +172,9 @@ public class CVSResourceVariantTree extends ResourceVariantTree { bytes = null; } else { // Use the folder sync from the workspace and the tag from the store - FolderSyncInfo newInfo = new FolderSyncInfo(info.getRepository(), info.getRoot(), tag, false); + MutableFolderSyncInfo newInfo = info.cloneMutable(); + newInfo.setTag(tag); + newInfo.setStatic(false); bytes = newInfo.getBytes(); } return bytes; @@ -210,7 +212,8 @@ public class CVSResourceVariantTree extends ResourceVariantTree { // Use the info from the remote except get the tag from the locla parent CVSTag tag = CVSWorkspaceRoot.getCVSFolderFor(local.getParent()).getFolderSyncInfo().getTag(); FolderSyncInfo info = FolderSyncInfo.getFolderSyncInfo(remote.asBytes()); - FolderSyncInfo newInfo = new FolderSyncInfo(info.getRepository(), info.getRoot(), tag, info.getIsStatic()); + MutableFolderSyncInfo newInfo = info.cloneMutable(); + newInfo.setTag(tag); ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IFolder)local); cvsFolder.setFolderSyncInfo(newInfo); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java index 6fb705e9a..2df1ff611 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo.java @@ -40,14 +40,14 @@ public class FolderSyncInfo { protected String repository; // :pserver:user@host:/home/user/repo - private String root; + protected String root; // sticky tag (e.g. version, date, or branch tag applied to folder) private CVSEntryLineTag tag; // if true then it means only part of the folder was fetched from the repository, and CVS will not create // additional files in that folder. - private boolean isStatic; + protected boolean isStatic; /** * Construct a folder sync object. @@ -321,4 +321,8 @@ public class FolderSyncInfo { public boolean isVirtualDirectory() { return getRepository().equals(VIRTUAL_DIRECTORY); } + + public FolderSyncInfo asImmutable() { + return this; + } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java index ae05c5b5e..adf7ddbeb 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableFolderSyncInfo.java @@ -28,36 +28,31 @@ import org.eclipse.team.internal.ccvs.core.CVSTag; */ public class MutableFolderSyncInfo extends FolderSyncInfo { - /** - * Constructor MutableFolderSyncInfo. - * @param folderSyncInfo - */ public MutableFolderSyncInfo(FolderSyncInfo info) { this(info.getRepository(), info.getRoot(), info.getTag(), info.getIsStatic()); } - /** - * Constructor for MutableFolderSyncInfo. - * @param repo - * @param root - * @param tag - * @param isStatic - */ public MutableFolderSyncInfo(String repo, String root, CVSTag tag, boolean isStatic) { super(repo, root, tag, isStatic); } - /** - * @see org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo#setTag(org.eclipse.team.internal.ccvs.core.CVSTag) - */ public void setTag(CVSTag tag) { super.setTag(tag); } - /** - * Method setRepository. - * @param string - */ + public void setRepository(String repository) { this.repository = repository; } + + public void setStatic(boolean isStatic) { + this.isStatic = isStatic; + } + + public FolderSyncInfo asImmutable() { + return new FolderSyncInfo(getRepository(), getRoot(), getTag(), getIsStatic()); + } + + public void setRoot(String root) { + this.root = root; + } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableResourceSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableResourceSyncInfo.java index b4a9569e5..ca275c971 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableResourceSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/MutableResourceSyncInfo.java @@ -33,14 +33,10 @@ import org.eclipse.team.internal.ccvs.core.util.Assert; */ public class MutableResourceSyncInfo extends ResourceSyncInfo { - boolean reported; - boolean changed; - protected MutableResourceSyncInfo(ResourceSyncInfo info) { this.name = info.getName(); setRevision(info.getRevision()); setTag(info.getTag()); - this.permissions = info.getPermissions(); this.timeStamp = info.getTimeStamp(); this.isDirectory = info.isDirectory(); this.keywordMode = info.getKeywordMode(); @@ -62,12 +58,6 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { Assert.isNotNull(name); this.name = name; setRevision(revision); - this.reported = false; - this.changed = false; - } - - void setResourceInfoType(int type) { - this.syncType = type; } /** @@ -84,7 +74,6 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { */ public void setTimeStamp(Date timeStamp) { this.timeStamp = timeStamp; - this.changed = true; } /** @@ -102,7 +91,6 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { */ public void setKeywordMode(KSubstOption keywordMode) { this.keywordMode = keywordMode; - this.changed = true; } /** @@ -114,20 +102,11 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { } /** - * Sets the permissions. - * @param permissions The permissions to set - */ - public void setPermissions(String permissions) { - this.permissions = permissions; - } - - /** * Sets the deleted state. * @param isDeleted The deleted state of this resource sync */ public void setDeleted(boolean isDeleted) { - this.isDeleted = isDeleted; - this.changed = true; + this.isDeleted = isDeleted;; } /** @@ -135,7 +114,6 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { */ public void setAdded() { setRevision(ADDED_REVISION); - this.changed = true; } /** @@ -145,22 +123,13 @@ public class MutableResourceSyncInfo extends ResourceSyncInfo { // if already merged state then ignore if(syncType==TYPE_REGULAR) { this.syncType = TYPE_MERGED; - this.changed = true; } } - public boolean needsReporting() { - return changed && !reported; - } - - public void reported() { - this.reported = true; - } /** * @see org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo#setEntryLine(java.lang.String) */ public void setEntryLine(String entryLine) throws CVSException { super.setEntryLine(entryLine); - this.changed = true; } } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java index 5b180745e..1a546e468 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo.java @@ -15,14 +15,10 @@ package org.eclipse.team.internal.ccvs.core.syncinfo; import java.text.ParseException; import java.util.Date; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.core.Policy; +import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag; -import org.eclipse.team.internal.ccvs.core.util.Assert; -import org.eclipse.team.internal.ccvs.core.util.CVSDateFormatter; -import org.eclipse.team.internal.ccvs.core.util.Util; +import org.eclipse.team.internal.ccvs.core.util.*; /** * Value (immutable) object that represents workspace state information about a resource contained in @@ -89,7 +85,6 @@ public class ResourceSyncInfo { protected Date timeStamp; protected KSubstOption keywordMode; protected CVSEntryLineTag tag; - protected String permissions; // type of sync protected int syncType = TYPE_REGULAR; @@ -98,7 +93,7 @@ public class ResourceSyncInfo { } public ResourceSyncInfo(byte[] entryLine) throws CVSException { - this(new String(entryLine), null, null); + this(new String(entryLine), null); } /** @@ -111,13 +106,10 @@ public class ResourceSyncInfo { * * @exception CVSException is thrown if the entry cannot be parsed. */ - public ResourceSyncInfo(String entryLine, String permissions, Date timestamp) throws CVSException { + public ResourceSyncInfo(String entryLine, Date timestamp) throws CVSException { Assert.isNotNull(entryLine); setEntryLine(entryLine); - if (permissions != null) { - this.permissions = permissions; - } // override the timestamp that may of been in entryLine. In some cases the timestamp is not in the // entry line (e.g. receiving entry lines from the server versus reading them from the Entry file). if(timestamp!=null) { @@ -238,40 +230,6 @@ public class ResourceSyncInfo { } /** - * Anwsers a compatible permissions line for files. - * - * @return a permission line for files and <code>null</code> if this sync object is - * a directory. - */ - public String getPermissionLine() { - if(isDirectory) { - return null; - } else { - String permissions = this.permissions; - if (permissions == null) - permissions = DEFAULT_PERMISSIONS; - return SEPARATOR + name + SEPARATOR + permissions; - } - } - - /** - * Gets the permissions. Returns <code>null</code> for directories and - * a non-null permission for files. - * - * @return a string of the format "u=rw,g=rw,o=r" - */ - public String getPermissions() { - if(isDirectory) { - return null; - } else { - if(permissions==null) { - return DEFAULT_PERMISSIONS; - } else { - return permissions; - } - } - } - /** * Gets the tag or <code>null</code> if a tag is not available. * * @return Returns a String @@ -537,14 +495,6 @@ public class ResourceSyncInfo { return result.toString(); } - public boolean needsReporting() { - return false; - } - - public void reported() { - // do nothing - } - /** * Method getBytes. * @return byte[] diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java index 489a71ec5..9fa26f163 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java @@ -23,10 +23,6 @@ package org.eclipse.team.internal.ccvs.core.util; /* package */ class AssertionFailedException extends RuntimeException { private static final long serialVersionUID = 1L; -/** Constructs a new exception. - */ -public AssertionFailedException() { -} /** Constructs a new exception with the given message. */ public AssertionFailedException(String detail) { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/CVSDateFormatter.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/CVSDateFormatter.java index a9a31aad8..2b66a843e 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/CVSDateFormatter.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/CVSDateFormatter.java @@ -43,11 +43,6 @@ public class CVSDateFormatter { Date date = serverFormat.parse(text); return date; } - - static synchronized public String dateToServerStamp(Date date) { - serverFormat.setTimeZone(TimeZone.getTimeZone("GMT"));//$NON-NLS-1$ - return serverFormat.format(date) + " -0000"; //$NON-NLS-1$ - } static synchronized public Date entryLineToDate(String text) throws ParseException { try { diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ReplaceWithBaseVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ReplaceWithBaseVisitor.java deleted file mode 100644 index e9bcfd09a..000000000 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ReplaceWithBaseVisitor.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 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.util; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; -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.resources.CVSWorkspaceRoot; -import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; -import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; - -public class ReplaceWithBaseVisitor implements ICVSResourceVisitor { - - private IProgressMonitor monitor; - private int depth; - private Session session; - - /** - * @see ICVSResourceVisitor#visitFile(ICVSFile) - */ - public void visitFile(final ICVSFile file) throws CVSException { - byte[] syncBytes = file.getSyncBytes(); - if (syncBytes == null) { - // Delete unmanaged files if the user wants them deleted - if (CVSProviderPlugin.getPlugin().isReplaceUnmanaged()) { - file.delete(); - } - } else if (ResourceSyncInfo.isAddition(syncBytes)) { - file.delete(); - file.unmanage(null); - } else { - byte[] tagBytes = ResourceSyncInfo.getTagBytes(syncBytes); - boolean isModified = file.isModified(null); - if (ResourceSyncInfo.isDeletion(syncBytes)) { - // If deleted, null the sync info so the file will be refetched - syncBytes = ResourceSyncInfo.convertFromDeletion(syncBytes); - file.setSyncBytes(syncBytes, ICVSFile.UNKNOWN); - isModified = true; - } - // Fetch the file from the server - if (isModified) { - // Use the session opened in tghe replaceWithBase method to make the connection. - Command.UPDATE.execute(this.session, Command.NO_GLOBAL_OPTIONS, - new LocalOption[] {Update.makeTagOption(CVSTag.BASE), Update.IGNORE_LOCAL_CHANGES}, - new ICVSResource[] { file }, null, Policy.subMonitorFor(monitor, 1)); - - // Set the tag to be the original tag - syncBytes = file.getSyncBytes(); - syncBytes = ResourceSyncInfo.setTag(syncBytes, tagBytes); - file.setSyncBytes(syncBytes, ICVSFile.UNKNOWN); - } - } - monitor.worked(1); - } - - /** - * @see ICVSResourceVisitor#visitFolder(ICVSFolder) - */ - public void visitFolder(ICVSFolder folder) throws CVSException { - // Visit the children of the folder as appropriate - if (depth == IResource.DEPTH_INFINITE) { - folder.acceptChildren(this); - } else if (depth == IResource.DEPTH_ONE) { - ICVSResource[] files = folder.members(ICVSFolder.FILE_MEMBERS); - for (int i = 0; i < files.length; i++) { - files[i].accept(this); - } - } - // Also delete ignored child files that start with .# - ICVSResource[] ignoredFiles = folder.members(ICVSFolder.FILE_MEMBERS | ICVSFolder.IGNORED_MEMBERS); - for (int i = 0; i < ignoredFiles.length; i++) { - ICVSResource cvsResource = ignoredFiles[i]; - if (cvsResource.getName().startsWith(".#")) { //$NON-NLS-1$ - cvsResource.delete(); - } - } - monitor.worked(1); - } - - /* - * This method will replace any changed resources in the local workspace with the - * base resource. Although CVS allows this operation using "cvs update -r BASE" the - * results in the workspace are "sticky". This operation does not leave the local workspace "sticky". - * - * NOTE: This operation issues multiple commands over a single connection. It may fail - * with some servers that are configured to run scripts during an update (see bug 40145). - */ - public void replaceWithBase(IProject project, final IResource[] resources, int depth, IProgressMonitor pm) throws CVSException { - this.depth = depth; - final ICVSFolder root = CVSWorkspaceRoot.getCVSFolderFor(project); - FolderSyncInfo folderInfo = root.getFolderSyncInfo(); - IProgressMonitor monitor = Policy.monitorFor(pm); - monitor.beginTask(null, 100); - this.session = new Session(KnownRepositories.getInstance().getRepository(folderInfo.getRoot()), root, true /* creat e backups */); - this.session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */); - try { - this.monitor = Policy.infiniteSubMonitorFor(monitor, 90); - this.monitor.beginTask(null, 512); - for (int i = 0; i < resources.length; i++) { - this.monitor.subTask(Policy.bind("ReplaceWithBaseVisitor.replacing", resources[i].getFullPath().toString())); //$NON-NLS-1$ - CVSWorkspaceRoot.getCVSResourceFor(resources[i]).accept(this); - } - } finally { - this.session.close(); - monitor.done(); - } - } -} diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java index ba49dd54b..7872537e4 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/SyncFileWriter.java @@ -11,41 +11,14 @@ package org.eclipse.team.internal.ccvs.core.util; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.io.*; +import java.util.*; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; -import org.eclipse.team.internal.ccvs.core.CVSStatus; -import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.core.Policy; +import org.eclipse.core.resources.*; +import org.eclipse.core.runtime.*; +import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag; -import org.eclipse.team.internal.ccvs.core.syncinfo.BaserevInfo; -import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; -import org.eclipse.team.internal.ccvs.core.syncinfo.NotifyInfo; -import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; +import org.eclipse.team.internal.ccvs.core.syncinfo.*; /* * This is a helper class that knows the format of the CVS metafiles. It @@ -104,7 +77,7 @@ public class SyncFileWriter { String line = entries[i]; if(!FOLDER_TAG.equals(line) && !"".equals(line)) { //$NON-NLS-1$ try { - ResourceSyncInfo info = new ResourceSyncInfo(line, null, null); + ResourceSyncInfo info = new ResourceSyncInfo(line, null); infos.put(info.getName(), info); } catch (CVSException e) { // There was a problem parsing the entry line. @@ -121,11 +94,11 @@ public class SyncFileWriter { String line = entriesLog[i]; if (line.startsWith(ADD_TAG)) { line = line.substring(ADD_TAG.length()); - ResourceSyncInfo info = new ResourceSyncInfo(line, null, null); + ResourceSyncInfo info = new ResourceSyncInfo(line, null); infos.put(info.getName(), info); } else if (line.startsWith(REMOVE_TAG)) { line = line.substring(REMOVE_TAG.length()); - ResourceSyncInfo info = new ResourceSyncInfo(line, null, null); + ResourceSyncInfo info = new ResourceSyncInfo(line, null); infos.remove(info.getName()); } } @@ -499,28 +472,6 @@ public class SyncFileWriter { } /* - * Reads all lines of the specified file. - * Returns null if the file does not exist. - */ - public static byte[][] readLines(InputStream stream) throws CVSException { - try { - BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); - List fileContentStore = new ArrayList(); - try { - String line; - while ((line = reader.readLine()) != null) { - fileContentStore.add(line.getBytes()); - } - return (byte[][]) fileContentStore.toArray(new byte[fileContentStore.size()][]); - } finally { - reader.close(); - } - } catch (IOException e) { - throw CVSException.wrapException(e); - } - } - - /* * Writes all lines to the specified file, using linefeed terminators for * compatibility with other CVS clients. */ |