diff options
author | Michael Valenta | 2002-02-15 21:51:18 +0000 |
---|---|---|
committer | Michael Valenta | 2002-02-15 21:51:18 +0000 |
commit | b74eb9a3a0bcb97104a8be488e09501315197f98 (patch) | |
tree | 78fc6899b930760005863a7500b35920d175eaa7 | |
parent | b59d02bf6421c5da650753fedbcfc763f1115808 (diff) | |
download | eclipse.platform.team-branch_9734.tar.gz eclipse.platform.team-branch_9734.tar.xz eclipse.platform.team-branch_9734.zip |
branched to work on CVS NT supportbranch_9734
5 files changed, 72 insertions, 20 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml index 219587b21..57534dcd3 100644 --- a/bundles/org.eclipse.team.cvs.core/plugin.xml +++ b/bundles/org.eclipse.team.cvs.core/plugin.xml @@ -18,4 +18,34 @@ </library> </runtime> + <!-- *************** Extension Points **************** --> + <extension-point name="Authenticator" id="authenticator"/> + <extension-point name="ConnectionMethods" id="connectionmethods"/> + + <!-- *************** Conection Methods **************** --> + <extension id="pserver" point="org.eclipse.team.cvs.core.connectionmethods"> + <adapter> + <run class="org.eclipse.team.internal.ccvs.core.connection.PServerConnectionMethod"> + <parameter name="trace" value="false" /> + </run> + </adapter> + </extension> + + <!-- *************** Team Provider **************** --> + <extension id="CVSProvider" point="org.eclipse.team.core.providers"> + <providers natureId="org.eclipse.team.cvs.core.cvsnature"/> + </extension> + + <!-- *************** Project Nature **************** --> + <extension point="org.eclipse.core.resources.natures" id="cvsnature" name="%cvsNature"> + <runtime> + <run class="org.eclipse.team.ccvs.core.CVSTeamProvider"/> + </runtime> + </extension> + + <!-- *************** Resource patterns ignored by CVS **************** --> + <extension point="org.eclipse.team.core.ignore"> + <ignore pattern = ".#*" selected = "true"/> + </extension> + </plugin>
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java index 8dd896d42..839b0fcb2 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java @@ -118,6 +118,7 @@ public class Checkout extends Command { return status; // Do not shorten paths if there is more than one expansion + // XXX We need to investigate when -N should be used if (session.getModuleExpansions().length > 1) { if ( ! DO_NOT_SHORTEN.isElementOf(localOptions)) { LocalOption[] newLocalOptions = new LocalOption[localOptions.length + 1]; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java index fbabbe0d0..aad66f1df 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java @@ -99,8 +99,10 @@ public abstract class Command { registerResponseHandler(new StaticHandler(false)); registerResponseHandler(new StickyHandler(true)); registerResponseHandler(new StickyHandler(false)); - registerResponseHandler(new UpdatedHandler(true)); - registerResponseHandler(new UpdatedHandler(false)); + registerResponseHandler(new UpdatedHandler(UpdatedHandler.HANDLE_UPDATED)); + registerResponseHandler(new UpdatedHandler(UpdatedHandler.HANDLE_UPDATE_EXISTING)); + registerResponseHandler(new UpdatedHandler(UpdatedHandler.HANDLE_CREATED)); + registerResponseHandler(new UpdatedHandler(UpdatedHandler.HANDLE_MERGED)); registerResponseHandler(new ValidRequestsHandler()); registerResponseHandler(new ModuleExpansionHandler()); } @@ -383,14 +385,14 @@ public abstract class Command { Option[] gOptions = makeAndSendOptions(session, globalOptions, getDefaultGlobalOptions(globalOptions, localOptions)); Option[] lOptions = makeAndSendOptions(session, localOptions, getDefaultLocalOptions(globalOptions, localOptions)); + // send arguments + sendArguments(session, arguments); // send local working directory state sendLocalResourceState(session, globalOptions, localOptions, resources, Policy.subMonitorFor(monitor, 10)); Policy.checkCanceled(monitor); // send local working directory path sendLocalWorkingDirectory(session); - // send arguments - sendArguments(session, arguments); // send command session.sendCommand(getCommandId()); @@ -479,6 +481,7 @@ public abstract class Command { IStatus status = listener.messageLine(argument, session.getLocalRoot(), monitor); if (status != ICommandOutputListener.OK) accumulatedStatus.add(status); if (consoleListener != null && session.isOutputToConsole()) consoleListener.messageLine(argument, null, null); + } else if (response.equals("MT")) { //$NON-NLS-1$ } else if (response.equals("E")) { //$NON-NLS-1$ IStatus status = listener.errorLine(argument, session.getLocalRoot(), monitor); if (status != ICommandOutputListener.OK) accumulatedStatus.add(status); @@ -530,13 +533,12 @@ public abstract class Command { * @return a space-delimited list of all valid response strings */ static String makeResponseList() { - StringBuffer result = new StringBuffer("ok error M E"); //$NON-NLS-1$ + StringBuffer result = new StringBuffer("ok error M MT E"); //$NON-NLS-1$ Iterator elements = responseHandlers.keySet().iterator(); while (elements.hasNext()) { result.append(' '); result.append((String) elements.next()); } - return result.toString(); } 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 99082478a..735e49732 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 @@ -70,6 +70,13 @@ public class Session { private static boolean MUST_CONVERT_NEWLINES = PLATFORM_NEWLINE_BYTES.length != 1 && PLATFORM_NEWLINE_BYTES[0] != SERVER_NEWLINE_BYTE; + public static final String[] ALL_VALID_RESPONSES = new String[] { + "ok", "error", "Valid-requests", "Checked-in", "New-entry", "Checksum", "Copy-file", + "Updated", "Created", "Update-existing", "Merged", "Patched", "Rcs-diff", "Mode", "Mod-time", "Removed", + "Remove-entry", "Set-static-directory", "Clear-static-directory", "Set-sticky", "Clear-sticky", + "Template", "Set-checkin-prog", "Set-update-prog", "Notified", "Module-expansion", + "Wrapper-rcsOption", "M", "Mbinary", "E", "F", "MT"}; + // VCM 1.0 comitted files using CR/LF as a delimiter private static final int CARRIAGE_RETURN_BYTE = 0x0d; @@ -139,6 +146,9 @@ public class Session { if (connection != null) throw new IllegalStateException(); connection = location.openConnection(monitor); + // set the root directory on the server for this connection + connection.writeLine("Root " + getRepositoryRoot()); //$NON-NLS-1$ + // tell the server the names of the responses we can handle connection.writeLine("Valid-responses " + Command.makeResponseList()); //$NON-NLS-1$ @@ -148,9 +158,9 @@ public class Session { Command.VALID_REQUESTS.execute(this, Command.NO_GLOBAL_OPTIONS, Command.NO_LOCAL_OPTIONS, Command.NO_ARGUMENTS, null, monitor); outputToConsole = saveOutputToConsole; - - // set the root directory on the server for this connection - connection.writeLine("Root " + getRepositoryRoot()); //$NON-NLS-1$ + + // The protocol says it requires this + connection.writeLine("UseUnchanged"); } /** 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 5269bf7c1..ba4fa3bea 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 @@ -40,20 +40,29 @@ import org.eclipse.team.internal.ccvs.core.util.EntryFileDateFormat; * Requiers a exisiting parent-folder. */ class UpdatedHandler extends ResponseHandler { + + private int handlerType; + + protected static final int HANDLE_UPDATED = 1; + protected static final int HANDLE_MERGED = 2; + protected static final int HANDLE_UPDATE_EXISTING = 3; + protected static final int HANDLE_CREATED = 4; + private static final EntryFileDateFormat dateFormatter = new EntryFileDateFormat(); private static final String READ_ONLY_FLAG = "u=rw"; //$NON-NLS-1$ - private final boolean updateResponse; - public UpdatedHandler(boolean updateResponse) { - this.updateResponse = updateResponse; + public UpdatedHandler(int handlerType) { + this.handlerType = handlerType; } public String getResponseID() { - if (updateResponse) { - return "Updated"; //$NON-NLS-1$ - } else { - return "Merged"; //$NON-NLS-1$ + switch (handlerType) { + case HANDLE_UPDATED: return "Updated"; //$NON-NLS-1$ + case HANDLE_MERGED: return "Merged"; //$NON-NLS-1$ + case HANDLE_UPDATE_EXISTING: return "Update-existing"; //$NON-NLS-1$ + case HANDLE_CREATED: return "Created"; //$NON-NLS-1$ } + return null; } public void handle(Session session, String localDir, @@ -84,11 +93,11 @@ class UpdatedHandler extends ResponseHandler { String timestamp = null; if (modTime != null) timestamp = dateFormatter.formatDate(modTime); mFile.setTimeStamp(timestamp); - if (updateResponse) { - timestamp = mFile.getTimeStamp(); - } else { + if (handlerType == HANDLE_MERGED) { timestamp = ResourceSyncInfo.RESULT_OF_MERGE + mFile.getTimeStamp(); - } + } else { + timestamp = mFile.getTimeStamp(); + } mFile.setSyncInfo(new ResourceSyncInfo(entryLine, permissionsLine, timestamp)); } }
\ No newline at end of file |