From e738d029a1fed7f9003e40cda47fc2d1538614b2 Mon Sep 17 00:00:00 2001 From: Jean Michel-Lemieux Date: Tue, 23 Sep 2003 16:06:44 +0000 Subject: Bug 43187 [Team] [CVS] SourceForge anonymous checkout fails --- .../team/internal/ccvs/core/CVSProviderPlugin.java | 16 +------ .../core/connection/CVSRepositoryLocation.java | 25 ++-------- .../ccvs/ui/repo/CVSRepositoryPropertiesPage.java | 54 ---------------------- .../ui/repo/RepositoriesViewContentHandler.java | 1 - .../team/internal/ccvs/ui/repo/RepositoryRoot.java | 4 -- 5 files changed, 4 insertions(+), 96 deletions(-) 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 8c83238ae..2d1000b93 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 @@ -783,9 +783,6 @@ public class CVSProviderPlugin extends Plugin { for (int i = 0; i < count; i++) { ICVSRepositoryLocation root = getRepository(dis.readUTF()); String programName = dis.readUTF(); - if (!programName.equals(CVSRepositoryLocation.DEFAULT_REMOTE_CVS_PROGRAM_NAME)) { - ((CVSRepositoryLocation)root).setRemoteCVSProgramName(programName); - } } } else { Util.logError(Policy.bind("CVSProviderPlugin.unknownStateFileVersion", new Integer(count).toString()), null); //$NON-NLS-1$ @@ -802,7 +799,7 @@ public class CVSProviderPlugin extends Plugin { while (it.hasNext()) { CVSRepositoryLocation root = (CVSRepositoryLocation)it.next(); dos.writeUTF(root.getLocation()); - dos.writeUTF(root.getRemoteCVSProgramName()); + dos.writeUTF("unused"); // place holder for an additional configuration parameter } } @@ -827,17 +824,6 @@ public class CVSProviderPlugin extends Plugin { this.determineVersionEnabled = determineVersionEnabled; } - /** - * Set the program name of the given repository location. - * The program name is the expected prefix on server text messages. - * Since we extract information out of these messages, we need to - * know what prefix to expect. The default is "cvs". - */ - public void setCVSProgramName(ICVSRepositoryLocation location, String programName) { - ((CVSRepositoryLocation)location).setRemoteCVSProgramName(programName); - saveState(); - } - /** * Method getResetTimestampOfFalseChange. * @return boolean 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 1c098d514..6bca062ff 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 @@ -98,14 +98,12 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit private boolean passwordFixed; private int serverPlatform = UNDETERMINED_PLATFORM; - private String remoteCVSProgramName = DEFAULT_REMOTE_CVS_PROGRAM_NAME; public static final char COLON = ':'; public static final char HOST_SEPARATOR = '@'; public static final char PORT_SEPARATOR = '#'; public static final boolean STANDALONE_MODE = (System.getProperty("eclipse.cvs.standalone")==null) ? //$NON-NLS-1$ false :(new Boolean(System.getProperty("eclipse.cvs.standalone")).booleanValue()); //$NON-NLS-1$ - public static final String DEFAULT_REMOTE_CVS_PROGRAM_NAME = "cvs"; //$NON-NLS-1$ // command to start remote cvs in server mode private static final String INVOKE_SVR_CMD = "server"; //$NON-NLS-1$ @@ -943,23 +941,6 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit oldString, newString); } - /** - * Return the name of the cvs program on the remote server. - * The default is "cvs" but it can be tailored for some servers - * @return String - */ - public String getRemoteCVSProgramName() { - return remoteCVSProgramName; - } - - /** - * Sets the remoteCVSProgramName. - * @param remoteCVSProgramName The remoteCVSProgramName to set - */ - public void setRemoteCVSProgramName(String remoteCVSProgramName) { - this.remoteCVSProgramName = remoteCVSProgramName; - } - /** * Return the server message with the prefix removed. * Server aborted messages typically start with @@ -969,10 +950,10 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit */ public String getServerMessageWithoutPrefix(String errorLine, String prefix) { String message = errorLine; - String programName = getRemoteCVSProgramName(); - if (message.startsWith(programName)) { + int firstSpace = message.indexOf(' '); + if(firstSpace != -1) { // remove the program name and the space - message = message.substring(programName.length() + 1); + message = message.substring(firstSpace + 1); if (message.startsWith(prefix)) { message = message.substring(prefix.length()); if (message.charAt(0) == ' ') { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java index d870c6b4f..e1ec233d3 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/CVSRepositoryPropertiesPage.java @@ -67,10 +67,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { IUserInfo info; - // Program Name - private Text programNameText; - private Button useDefaultProgramName; - private Button useCustomProgramName; // Label private Button useLocationAsLabel; private Button useCustomLabel; @@ -139,20 +135,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { // Add some extra space createLabel(composite, "", 3); //$NON-NLS-1$ - // Remote CVS program name - // create a composite to ensure the radio buttons come in the correct order - Composite programNameGroup = createRadioGroupComposite(composite); - Listener programNameListener = new Listener() { - public void handleEvent(Event event) { - updateWidgetEnablements(); - } - }; - useDefaultProgramName = createRadioButton(programNameGroup, Policy.bind("CVSRepositoryPropertiesPage.useDefaultProgramName"), 3); //$NON-NLS-1$ - useCustomProgramName = createRadioButton(programNameGroup, Policy.bind("CVSRepositoryPropertiesPage.useProgramName"), 1); //$NON-NLS-1$ - useCustomProgramName.addListener(SWT.Selection, programNameListener); - programNameText = createTextField(programNameGroup); - programNameText.addListener(SWT.Modify, programNameListener); - // Add some extra space createLabel(composite, "", 3); //$NON-NLS-1$ @@ -341,12 +323,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { } pathLabel.setText(location.getRootDirectory()); - // get the program name - String programName = ((CVSRepositoryLocation)location).getRemoteCVSProgramName(); - programNameText.setText(programName); - useDefaultProgramName.setSelection(programName == CVSRepositoryLocation.DEFAULT_REMOTE_CVS_PROGRAM_NAME); - useCustomProgramName.setSelection(!useDefaultProgramName.getSelection()); - // get the repository label String label = null; RepositoryRoot root = CVSUIPlugin.getPlugin().getRepositoryManager().getRepositoryRootFor(location); @@ -492,7 +468,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { } private void performNonConnectionInfoChanges() { - recordNewProgramName((CVSRepositoryLocation)location); recordNewLabel((CVSRepositoryLocation)location); recordReadWriteLocations((CVSRepositoryLocation)location); } @@ -517,11 +492,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { * Updates widget enablements and sets error message if appropriate. */ protected void updateWidgetEnablements() { - if (useDefaultProgramName.getSelection()) { - programNameText.setEnabled(false); - } else { - programNameText.setEnabled(true); - } if (useLocationAsLabel.getSelection()) { labelText.setEnabled(false); } else { @@ -538,12 +508,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { } private void validateFields() { - if (programNameText.isEnabled()) { - if (programNameText.getText().length() == 0) { - setValid(false); - return; - } - } if (labelText.isEnabled()) { if (labelText.getText().length() == 0) { setValid(false); @@ -553,24 +517,6 @@ public class CVSRepositoryPropertiesPage extends PropertyPage { setValid(true); } - private void recordNewProgramName(CVSRepositoryLocation location) { - String newProgramName = getNewProgramName(); - if (getOldProgramName(location).equals(newProgramName)) return; - CVSProviderPlugin.getPlugin().setCVSProgramName(location, newProgramName); - } - private String getOldProgramName(CVSRepositoryLocation location) { - return location.getRemoteCVSProgramName(); - } - private String getNewProgramName() { - // Set the remote program name if appropriate - String newProgramName; - if (useDefaultProgramName.getSelection()) { - newProgramName = CVSRepositoryLocation.DEFAULT_REMOTE_CVS_PROGRAM_NAME; - } else { - newProgramName = programNameText.getText(); - } - return newProgramName; - } private void recordNewLabel(CVSRepositoryLocation location) { String newLabel = getNewLabel(location); if (newLabel == null) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java index 1336bb339..d40b0cfdb 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoriesViewContentHandler.java @@ -41,7 +41,6 @@ public class RepositoriesViewContentHandler extends DefaultHandler { public static final String PATH_ATTRIBUTE = "path"; //$NON-NLS-1$ public static final String FULL_PATH_ATTRIBUTE = "full-path"; //$NON-NLS-1$ public static final String TYPE_ATTRIBUTE = "type"; //$NON-NLS-1$ - public static final String REPOSITORY_PROGRAM_NAME_ATTRIBUTE = "program-name"; //$NON-NLS-1$ public static final String READ_ID_ATTRIBUTE = "read-id"; //$NON-NLS-1$ public static final String WRITE_ID_ATTRIBUTE = "write-id"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java index 8e7c3ea2f..c78467b60 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java @@ -338,10 +338,6 @@ public class RepositoryRoot extends PlatformObject { attributes.clear(); attributes.put(RepositoriesViewContentHandler.ID_ATTRIBUTE, root.getLocation()); - String programName = ((CVSRepositoryLocation)root).getRemoteCVSProgramName(); - if (!programName.equals(CVSRepositoryLocation.DEFAULT_REMOTE_CVS_PROGRAM_NAME)) { - attributes.put(RepositoriesViewContentHandler.REPOSITORY_PROGRAM_NAME_ATTRIBUTE, programName); - } if (name != null) { attributes.put(RepositoriesViewContentHandler.NAME_ATTRIBUTE, name); } -- cgit v1.2.3