Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-05-18 14:07:38 +0000
committerPaul Pazderski2019-05-19 23:54:17 +0000
commitde3c0c5ff08c928e6d1eb4fac2704bbb2d261669 (patch)
treede6e0a11c45731a312b5e239c22387afe93fe19c /bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client
parent5e9e26b1abe5bd1df37faa91fde2d87fd79ed06b (diff)
downloadeclipse.platform.team-de3c0c5ff08c928e6d1eb4fac2704bbb2d261669.tar.gz
eclipse.platform.team-de3c0c5ff08c928e6d1eb4fac2704bbb2d261669.tar.xz
eclipse.platform.team-de3c0c5ff08c928e6d1eb4fac2704bbb2d261669.zip
This change fixes space or mixed tab/space indentations in all Java files. This also includes two or three space indentations and even fix most stray single spaces in indentations. The change includes only whitespace formatting and no code changes. Change-Id: I4149aaf4e48ccf7b49083f36d52e0c7a67433c7d
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client')
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java70
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java38
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Annotate.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java104
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java20
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ConsoleListeners.java184
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java26
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java24
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java36
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java18
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java126
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java112
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java28
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java36
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java26
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java30
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java44
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AdminKSubstListener.java54
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AnnotateListener.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ILogEntryListener.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogEntry.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java582
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java10
31 files changed, 820 insertions, 820 deletions
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 6de8222b1..ee7934bc5 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
@@ -44,8 +44,8 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
protected boolean sendQuestionable;
protected boolean sendModifiedContents;
private boolean sendBinary;
-
- private boolean recurse = true;
+
+ private boolean recurse = true;
public AbstractStructureVisitor(Session session, LocalOption[] localOptions, boolean sendQuestionable, boolean sendModifiedContents) {
this(session, localOptions, sendQuestionable, sendModifiedContents, true);
@@ -56,8 +56,8 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
this.sendQuestionable = sendQuestionable;
this.sendModifiedContents = sendModifiedContents;
this.sendBinary = sendBinary;
- if (Command.DO_NOT_RECURSE.isElementOf(localOptions))
- recurse = false;
+ if (Command.DO_NOT_RECURSE.isElementOf(localOptions))
+ recurse = false;
}
/**
@@ -107,7 +107,7 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
if (isLastSent(mFolder)) return;
// Do not send virtual directories
- if (isCVSFolder && info.isVirtualDirectory()) {
+ if (isCVSFolder && info.isVirtualDirectory()) {
return;
}
@@ -171,7 +171,7 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
boolean isManaged = syncBytes != null;
if (isManaged) {
- sendPendingNotification(mFile);
+ sendPendingNotification(mFile);
} else {
// If the file is not managed, send a questionable to the server if the file exists locally
// A unmanaged, locally non-existant file results from the explicit use of the file name as a command argument
@@ -190,15 +190,15 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
boolean sendContents = mFile.exists() && mFile.isModified(monitor)
&& !mFile.getSyncInfo().isNeedsMerge(mFile.getTimeStamp());
if (ResourceSyncInfo.isDeletion(syncBytes)) {
- sendEntryLineToServer(mFile, syncBytes);
+ sendEntryLineToServer(mFile, syncBytes);
} else if (sendContents) {
- // Perform the send of modified contents in a sheduling rule to ensure that
- // the contents are not modified while we are sending them
- final IResource resource = mFile.getIResource();
- try {
- if (resource != null)
- Job.getJobManager().beginRule(resource, monitor);
-
+ // Perform the send of modified contents in a sheduling rule to ensure that
+ // the contents are not modified while we are sending them
+ final IResource resource = mFile.getIResource();
+ try {
+ if (resource != null)
+ Job.getJobManager().beginRule(resource, monitor);
+
sendEntryLineToServer(mFile, syncBytes);
if (mFile.exists() && mFile.isModified(null)) {
boolean binary = ResourceSyncInfo.isBinary(syncBytes);
@@ -210,26 +210,26 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
} else {
session.sendUnchanged(mFile);
}
- } finally {
- if (resource != null)
- Job.getJobManager().endRule(resource);
- }
+ } finally {
+ if (resource != null)
+ Job.getJobManager().endRule(resource);
+ }
} else {
- sendEntryLineToServer(mFile, syncBytes);
+ sendEntryLineToServer(mFile, syncBytes);
session.sendUnchanged(mFile);
}
monitor.worked(1);
}
- private void sendEntryLineToServer(ICVSFile mFile, byte[] syncBytes) throws CVSException {
- if (syncBytes != null) {
- String syncBytesToServer = ResourceSyncInfo.getTimestampToServer(syncBytes, mFile.getTimeStamp());
- session.sendEntry(syncBytes, syncBytesToServer);
- }
- }
+ private void sendEntryLineToServer(ICVSFile mFile, byte[] syncBytes) throws CVSException {
+ if (syncBytes != null) {
+ String syncBytesToServer = ResourceSyncInfo.getTimestampToServer(syncBytes, mFile.getTimeStamp());
+ session.sendEntry(syncBytes, syncBytesToServer);
+ }
+ }
- protected void sendPendingNotification(ICVSFile mFile) throws CVSException {
+ protected void sendPendingNotification(ICVSFile mFile) throws CVSException {
NotifyInfo notify = mFile.getPendingNotification();
if (notify != null) {
sendFolder(mFile.getParent());
@@ -284,16 +284,16 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
}
}
- /**
- * Return a send file message that contains one argument slot
- * for the file name.
- * @return a send file message that contains one argument slot
- * for the file name
- */
+ /**
+ * Return a send file message that contains one argument slot
+ * for the file name.
+ * @return a send file message that contains one argument slot
+ * for the file name
+ */
protected String getSendFileMessage() {
return CVSMessages.AbstractStructureVisitor_sendingFile;
}
- public boolean isRecurse() {
- return recurse;
- }
+ public boolean isRecurse() {
+ return 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 91648de5b..d2917d4f0 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
@@ -67,8 +67,8 @@ public class Add extends Command {
status = mergeStatus(status, new CVSStatus(IStatus.ERROR, NLS.bind(CVSMessages.Add_invalidParent, new String[] { mFolder.getRelativePath(session.getLocalRoot()) })));
} else {
String repository = info.getRepository() + "/" + mFolder.getName(); //$NON-NLS-1$
- MutableFolderSyncInfo newInfo = info.cloneMutable();
- newInfo.setRepository(repository);
+ MutableFolderSyncInfo newInfo = info.cloneMutable();
+ newInfo.setRepository(repository);
mFolder.setFolderSyncInfo(newInfo);
}
}
@@ -77,22 +77,22 @@ public class Add extends Command {
}
@Override
- protected ICommandOutputListener getDefaultCommandOutputListener() {
- return new CommandOutputListener() {
- public IStatus errorLine(String line,
- ICVSRepositoryLocation location, ICVSFolder commandRoot,
- IProgressMonitor monitor) {
-
- String serverMessage = getServerMessage(line, location);
- if (serverMessage != null) {
- if (serverMessage.indexOf("cvs commit") != -1 && serverMessage.indexOf("add") != -1 && serverMessage.indexOf("permanently") != -1) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return OK;
- if (serverMessage.startsWith("scheduling file") && serverMessage.indexOf("for addition") != -1) //$NON-NLS-1$ //$NON-NLS-2$
- return OK;
- }
- return super.errorLine(line, location, commandRoot, monitor);
- }
- };
- }
+ protected ICommandOutputListener getDefaultCommandOutputListener() {
+ return new CommandOutputListener() {
+ public IStatus errorLine(String line,
+ ICVSRepositoryLocation location, ICVSFolder commandRoot,
+ IProgressMonitor monitor) {
+
+ String serverMessage = getServerMessage(line, location);
+ if (serverMessage != null) {
+ if (serverMessage.indexOf("cvs commit") != -1 && serverMessage.indexOf("add") != -1 && serverMessage.indexOf("permanently") != -1) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return OK;
+ if (serverMessage.startsWith("scheduling file") && serverMessage.indexOf("for addition") != -1) //$NON-NLS-1$ //$NON-NLS-2$
+ 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/Annotate.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Annotate.java
index 043837727..d163ef33f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Annotate.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Annotate.java
@@ -20,7 +20,7 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
public class Annotate extends AbstractMessageCommand {
- public static final Object FORCE_BINARY_ANNOTATE = new LocalOption("-F"); //$NON-NLS-1$
+ public static final Object FORCE_BINARY_ANNOTATE = new LocalOption("-F"); //$NON-NLS-1$
protected Annotate() { }
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 eecda7900..4b0193f9c 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
@@ -179,8 +179,8 @@ public class Checkout extends Command {
return RemoteModule.createRemoteModules(moduleDefinitionListener.getModuleExpansions(), session.getCVSRepositoryLocation(), tag);
}
-
- protected String getDisplayText() {
- return "checkout"; //$NON-NLS-1$
- }
+
+ protected String getDisplayText() {
+ return "checkout"; //$NON-NLS-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 e9a6ebee8..aa8018827 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
@@ -79,7 +79,7 @@ public abstract class Command extends Request {
// Empty local option array
public static final LocalOption[] NO_LOCAL_OPTIONS = new LocalOption[0];
// valid for: annotate checkout commit diff export log rdiff remove rtag status tag update
- public static final LocalOption RECURSE = new LocalOption("-R"); //$NON-NLS-1$
+ public static final LocalOption RECURSE = new LocalOption("-R"); //$NON-NLS-1$
public static final LocalOption DO_NOT_RECURSE = new LocalOption("-l"); //$NON-NLS-1$
// valid for: checkout export update
public static final LocalOption PRUNE_EMPTY_DIRECTORIES = new LocalOption("-P"); //$NON-NLS-1$
@@ -324,7 +324,7 @@ public abstract class Command extends Request {
// run the command
try {
- session.setCurrentCommand(Command.this);
+ session.setCurrentCommand(Command.this);
status[0] = doExecute(session, gOptions, lOptions, arguments, listener, monitor);
notifyConsoleOnCompletion(session, status[0], null);
} catch (CVSException e1) {
@@ -560,28 +560,28 @@ public abstract class Command extends Request {
session.sendArgument(option);
if (argument != null) session.sendArgument(argument);
}
- public LocalOption[] addTo(LocalOption[] options) {
- if (this.isElementOf(options)) {
- return options;
- }
- LocalOption[] newOptions = new LocalOption[options.length + 1];
- System.arraycopy(options, 0, newOptions, 0, options.length);
- newOptions[options.length] = this;
- return newOptions;
- }
- public LocalOption[] removeFrom(LocalOption[] options) {
- if (!this.isElementOf(options)) {
- return options;
- }
- List result = new ArrayList();
- for (int i = 0; i < options.length; i++) {
- Command.LocalOption option = options[i];
- if (!option.equals(this)) {
- result.add(option);
- }
- }
- return (LocalOption[]) result.toArray(new LocalOption[result.size()]);
- }
+ public LocalOption[] addTo(LocalOption[] options) {
+ if (this.isElementOf(options)) {
+ return options;
+ }
+ LocalOption[] newOptions = new LocalOption[options.length + 1];
+ System.arraycopy(options, 0, newOptions, 0, options.length);
+ newOptions[options.length] = this;
+ return newOptions;
+ }
+ public LocalOption[] removeFrom(LocalOption[] options) {
+ if (!this.isElementOf(options)) {
+ return options;
+ }
+ List result = new ArrayList();
+ for (int i = 0; i < options.length; i++) {
+ Command.LocalOption option = options[i];
+ if (!option.equals(this)) {
+ result.add(option);
+ }
+ }
+ return (LocalOption[]) result.toArray(new LocalOption[result.size()]);
+ }
}
/**
* Options subtype for keyword substitution options.
@@ -654,40 +654,40 @@ public abstract class Command extends Request {
*/
public String getShortDisplayText() {
if (isUnknownMode)
- return NLS.bind(CVSMessages.KSubstOption_unknown_short, new String[] { option });
- if (option.equals("-kb")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kb_short;
- if (option.equals("-kkv")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kkv_short;
- if (option.equals("-ko")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__ko_short;
- if (option.equals("-kk")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kk_short;
- if (option.equals("-kv")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kv_short;
- if (option.equals("-kkvl")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kkvl_short;
- return NLS.bind(CVSMessages.KSubstOption_unknown_short, new String[] { option });
+ return NLS.bind(CVSMessages.KSubstOption_unknown_short, new String[] { option });
+ if (option.equals("-kb")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kb_short;
+ if (option.equals("-kkv")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kkv_short;
+ if (option.equals("-ko")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__ko_short;
+ if (option.equals("-kk")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kk_short;
+ if (option.equals("-kv")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kv_short;
+ if (option.equals("-kkvl")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kkvl_short;
+ return NLS.bind(CVSMessages.KSubstOption_unknown_short, new String[] { option });
}
/**
* Returns a long localized text string describing this mode.
*/
public String getLongDisplayText() {
if (isUnknownMode)
- return NLS.bind(CVSMessages.KSubstOption_unknown_long, new String[] { option });
- if (option.equals("-kb")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kb_long;
- if (option.equals("-kkv")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kkv_long;
- if (option.equals("-ko")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__ko_long;
- if (option.equals("-kk")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kk_long;
- if (option.equals("-kv")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kv_long;
- if (option.equals("-kkvl")) //$NON-NLS-1$
- return CVSMessages.KSubstOption__kkvl_long;
- return NLS.bind(CVSMessages.KSubstOption_unknown_long, new String[] { option });
+ return NLS.bind(CVSMessages.KSubstOption_unknown_long, new String[] { option });
+ if (option.equals("-kb")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kb_long;
+ if (option.equals("-kkv")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kkv_long;
+ if (option.equals("-ko")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__ko_long;
+ if (option.equals("-kk")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kk_long;
+ if (option.equals("-kv")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kv_long;
+ if (option.equals("-kkvl")) //$NON-NLS-1$
+ return CVSMessages.KSubstOption__kkvl_long;
+ return NLS.bind(CVSMessages.KSubstOption_unknown_long, new String[] { option });
}
/**
* Return the text mode that will be used by default
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
index 567c7c07f..9a4e30d83 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CommandOutputListener.java
@@ -20,14 +20,14 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListen
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
public class CommandOutputListener implements ICommandOutputListener {
-
- /*
- * Failure string that is returned from the server when pserver is used and the root directory
- * is not readable. The problem can be fixed by making the directory readable or by using -f in
- * the pserver configuration file. We will ignore the error since it does not affect the command.
- */
- public static final String ROOT_CVSIGNORE_READ_FAILURE = "cvs server: cannot open /root/.cvsignore: Permission denied"; //$NON-NLS-1$
-
+
+ /*
+ * Failure string that is returned from the server when pserver is used and the root directory
+ * is not readable. The problem can be fixed by making the directory readable or by using -f in
+ * the pserver configuration file. We will ignore the error since it does not affect the command.
+ */
+ public static final String ROOT_CVSIGNORE_READ_FAILURE = "cvs server: cannot open /root/.cvsignore: Permission denied"; //$NON-NLS-1$
+
public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
return OK;
}
@@ -37,8 +37,8 @@ public class CommandOutputListener implements ICommandOutputListener {
return new CVSStatus(IStatus.ERROR, CVSStatus.PROTOCOL_ERROR, protocolError, commandRoot);
}
if (line.equals(ROOT_CVSIGNORE_READ_FAILURE) || getServerMessage(ROOT_CVSIGNORE_READ_FAILURE, location).equals(getServerMessage(line, location))) {
- // Don't report this as an error since it does not affect the command
- return new CVSStatus(IStatus.WARNING, CVSStatus.ERROR_LINE, line, commandRoot);
+ // Don't report this as an error since it does not affect the command
+ return new CVSStatus(IStatus.WARNING, CVSStatus.ERROR_LINE, line, commandRoot);
}
return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE, line, commandRoot);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
index 90efdc551..2980cd5f9 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
@@ -132,8 +132,8 @@ public class Commit extends Command {
session.setTextTransferOverride(null);
}
}
-
- protected String getDisplayText() {
- return "commit"; //$NON-NLS-1$
- }
+
+ protected String getDisplayText() {
+ return "commit"; //$NON-NLS-1$
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ConsoleListeners.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ConsoleListeners.java
index 7f552dfe4..7ab88ad15 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ConsoleListeners.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ConsoleListeners.java
@@ -27,100 +27,100 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.IConsoleListener;
*/
public class ConsoleListeners implements IConsoleListener {
- private static ConsoleListeners instance = new ConsoleListeners();
- private Set listeners = new HashSet();
-
- /**
- * Return the console listeners
- * @return the console listeners
- */
- public static ConsoleListeners getInstance() {
- return instance;
- }
-
- public void addListener(IConsoleListener listener) {
- synchronized(listeners) {
- listeners.add(listener);
- }
- }
-
- public void removeListener(IConsoleListener listener) {
- synchronized(listeners) {
- listeners.remove(listener);
- }
- }
+ private static ConsoleListeners instance = new ConsoleListeners();
+ private Set listeners = new HashSet();
+
+ /**
+ * Return the console listeners
+ * @return the console listeners
+ */
+ public static ConsoleListeners getInstance() {
+ return instance;
+ }
+
+ public void addListener(IConsoleListener listener) {
+ synchronized(listeners) {
+ listeners.add(listener);
+ }
+ }
+
+ public void removeListener(IConsoleListener listener) {
+ synchronized(listeners) {
+ listeners.remove(listener);
+ }
+ }
- private IConsoleListener[] getListeners() {
- synchronized(listeners) {
- return (IConsoleListener[]) listeners.toArray(new IConsoleListener[listeners.size()]);
- }
- }
-
- @Override
- public void commandInvoked(final Session session, final String line) {
- if (listeners.isEmpty()) return;
- IConsoleListener[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IConsoleListener listener = listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exception logged by Platform
- }
- public void run() throws Exception {
- listener.commandInvoked(session, line);
- }
- });
- }
- }
+ private IConsoleListener[] getListeners() {
+ synchronized(listeners) {
+ return (IConsoleListener[]) listeners.toArray(new IConsoleListener[listeners.size()]);
+ }
+ }
+
+ @Override
+ public void commandInvoked(final Session session, final String line) {
+ if (listeners.isEmpty()) return;
+ IConsoleListener[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IConsoleListener listener = listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exception logged by Platform
+ }
+ public void run() throws Exception {
+ listener.commandInvoked(session, line);
+ }
+ });
+ }
+ }
- @Override
- public void messageLineReceived(final Session session, final String line, final IStatus status) {
- if (listeners.isEmpty()) return;
- IConsoleListener[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IConsoleListener listener = listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exception logged by Platform
- }
- public void run() throws Exception {
- listener.messageLineReceived(session, line, status);
- }
- });
- }
- }
+ @Override
+ public void messageLineReceived(final Session session, final String line, final IStatus status) {
+ if (listeners.isEmpty()) return;
+ IConsoleListener[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IConsoleListener listener = listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exception logged by Platform
+ }
+ public void run() throws Exception {
+ listener.messageLineReceived(session, line, status);
+ }
+ });
+ }
+ }
- @Override
- public void errorLineReceived(final Session session, final String line, final IStatus status) {
- if (listeners.isEmpty()) return;
- IConsoleListener[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IConsoleListener listener = listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exception logged by Platform
- }
- public void run() throws Exception {
- listener.errorLineReceived(session, line, status);
- }
- });
- }
- }
+ @Override
+ public void errorLineReceived(final Session session, final String line, final IStatus status) {
+ if (listeners.isEmpty()) return;
+ IConsoleListener[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IConsoleListener listener = listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exception logged by Platform
+ }
+ public void run() throws Exception {
+ listener.errorLineReceived(session, line, status);
+ }
+ });
+ }
+ }
- @Override
- public void commandCompleted(final Session session, final IStatus status, final Exception exception) {
- if (listeners.isEmpty()) return;
- IConsoleListener[] listeners = getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IConsoleListener listener = listeners[i];
- Platform.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Exception logged by Platform
- }
- public void run() throws Exception {
- listener.commandCompleted(session, status, exception);
- }
- });
- }
- }
+ @Override
+ public void commandCompleted(final Session session, final IStatus status, final Exception exception) {
+ if (listeners.isEmpty()) return;
+ IConsoleListener[] listeners = getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ final IConsoleListener listener = listeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // Exception logged by Platform
+ }
+ public void run() throws Exception {
+ listener.commandCompleted(session, status, exception);
+ }
+ });
+ }
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
index 9955fb0e6..33babbc23 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
@@ -42,21 +42,21 @@ public class Diff extends Command {
* so when there is a difference between the checked files.
*/
protected IStatus doExecute(Session session, GlobalOption[] globalOptions, LocalOption[] localOptions,
- String[] arguments, ICommandOutputListener listener, IProgressMonitor monitor) throws CVSException {
+ String[] arguments, ICommandOutputListener listener, IProgressMonitor monitor) throws CVSException {
try {
IStatus status = super.doExecute(session, globalOptions, localOptions, arguments, listener, monitor);
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- if (status.isMultiStatus()) {
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- IStatus child = children[i];
- if (child.getMessage().indexOf("[diff aborted]") != -1) { //$NON-NLS-1$
- throw new CVSServerException(status);
- }
- }
- }
- }
- return status;
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ if (status.isMultiStatus()) {
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ if (child.getMessage().indexOf("[diff aborted]") != -1) { //$NON-NLS-1$
+ throw new CVSServerException(status);
+ }
+ }
+ }
+ }
+ return status;
} catch (CVSServerException e) {
if (e.containsErrors()) throw e;
return e.getStatus();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
index 4091eed84..f4bf92070 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
@@ -73,9 +73,9 @@ class FileStructureVisitor extends AbstractStructureVisitor {
ICVSResource[] children = mFolder.members(ICVSFolder.ALL_UNIGNORED_MEMBERS);
sendFiles(children);
sendQuestionableFolders(children);
- if (isRecurse()) {
- sendManagedFolders(children);
- }
+ if (isRecurse()) {
+ sendManagedFolders(children);
+ }
}
/**
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 70f526ace..1310f7767 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
@@ -39,13 +39,13 @@ public class Import extends Command {
IProgressMonitor monitor) throws CVSException {
// If the branch option is not provided, a default value of 1.1.1 is used.
- // This is done to maintain reference client compatibility
- if (findOption(localOptions, "-b") == null) { //$NON-NLS-1$
- LocalOption[] newLocalOptions = new LocalOption[localOptions.length + 1];
+ // This is done to maintain reference client compatibility
+ if (findOption(localOptions, "-b") == null) { //$NON-NLS-1$
+ LocalOption[] newLocalOptions = new LocalOption[localOptions.length + 1];
newLocalOptions[0] = new LocalOption("-b", "1.1.1"); //$NON-NLS-1$ //$NON-NLS-2$
System.arraycopy(localOptions, 0, newLocalOptions, 1, localOptions.length);
localOptions = newLocalOptions;
- }
+ }
return super.doExecute(session, globalOptions, localOptions, arguments, listener, monitor);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
index 2338d2eb1..b0857c4a0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RLog.java
@@ -34,7 +34,7 @@ public class RLog extends RemoteCommand {
* ==== ==== =================================
* date date date<date (all revisions between date and later)
* tag tag tag:tag (all revisions between tag and tag, must be on same branch)
- * branch date >date (all revisions of date or later)
+ * branch date >date (all revisions of date or later)
* branch tag tag: (all revisions from tag to the end of branchs tip)
*
* Valid for: rlog
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
index eff261de8..58d8f5a46 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoteCommand.java
@@ -54,21 +54,21 @@ public abstract class RemoteCommand extends Command {
// Convert arguments
List stringArguments = new ArrayList(arguments.length);
for (int i = 0; i < arguments.length; i++) {
- ICVSResource resource = arguments[i];
- String remotePath;
- if (isDefinedModule(resource)) {
- remotePath = resource.getName();
- } else {
- remotePath = resource.getRepositoryRelativePath();
-
- }
- stringArguments.add(remotePath);
+ ICVSResource resource = arguments[i];
+ String remotePath;
+ if (isDefinedModule(resource)) {
+ remotePath = resource.getName();
+ } else {
+ remotePath = resource.getRepositoryRelativePath();
+
+ }
+ stringArguments.add(remotePath);
}
return (String[]) stringArguments.toArray(new String[stringArguments.size()]);
}
- private boolean isDefinedModule(ICVSResource resource) {
- return resource instanceof ICVSRemoteFolder && ((ICVSRemoteFolder)resource).isDefinedModule();
- }
+ private boolean isDefinedModule(ICVSResource resource) {
+ return resource instanceof ICVSRemoteFolder && ((ICVSRemoteFolder)resource).isDefinedModule();
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
index d452bf304..f08075f7d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
@@ -59,25 +59,25 @@ class RemovedHandler extends ResponseHandler {
// delete then unmanage the file
try {
- if (mFile.isReadOnly()) mFile.setReadOnly(false);
- mFile.delete();
- mFile.unmanage(null);
- } catch (CVSException e) {
- IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.RESPONSE_HANDLING_FAILURE, NLS.bind(CVSMessages.RemovedHandler_0, new String[] { getPath(mFile) }), e, session.getLocalRoot());
- session.handleResponseError(status);
- }
+ if (mFile.isReadOnly()) mFile.setReadOnly(false);
+ mFile.delete();
+ mFile.unmanage(null);
+ } catch (CVSException e) {
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.RESPONSE_HANDLING_FAILURE, NLS.bind(CVSMessages.RemovedHandler_0, new String[] { getPath(mFile) }), e, session.getLocalRoot());
+ session.handleResponseError(status);
+ }
}
- private String getPath(ICVSFile file) {
- IResource resource = file.getIResource();
- if (resource != null) {
- return resource.getFullPath().toString();
- }
- try {
- return file.getRepositoryRelativePath();
- } catch (CVSException e1) {
- return file.getName();
- }
- }
+ private String getPath(ICVSFile file) {
+ IResource resource = file.getIResource();
+ if (resource != null) {
+ return resource.getFullPath().toString();
+ }
+ try {
+ return file.getRepositoryRelativePath();
+ } catch (CVSException e1) {
+ return file.getName();
+ }
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
index fe1a6bec5..341ed488d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Request.java
@@ -114,7 +114,7 @@ public abstract class Request {
// move some rather than remaining still and then jumping to 100).
final int TOTAL_WORK = 300;
monitor.beginTask(CVSMessages.Command_receivingResponses, TOTAL_WORK);
- monitor.subTask(CVSMessages.Command_receivingResponses);
+ monitor.subTask(CVSMessages.Command_receivingResponses);
int halfWay = TOTAL_WORK / 2;
int currentIncrement = 4;
int nextProgress = currentIncrement;
@@ -168,18 +168,18 @@ public abstract class Request {
}
if (!session.hasErrors()) {
- session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, CVSMessages.Command_noMoreInfoAvailable,session.getLocalRoot()));
+ session.addError(new CVSStatus(IStatus.ERROR, CVSStatus.SERVER_ERROR, CVSMessages.Command_noMoreInfoAvailable,session.getLocalRoot()));
}
IStatus status = new MultiStatus(CVSProviderPlugin.ID, CVSStatus.SERVER_ERROR,
- session.getErrors(),
+ session.getErrors(),
argument, null);
if (serious) {
throw new CVSServerException(status);
} else {
// look for particularly bad errors in the accumulated statuses
- IStatus[] errors = session.getErrors();
- for (int i = 0; i < errors.length; i++) {
- IStatus s = errors[i];
+ IStatus[] errors = session.getErrors();
+ for (int i = 0; i < errors.length; i++) {
+ IStatus s = errors[i];
if (s.getCode() == CVSStatus.PROTOCOL_ERROR) {
throw new CVSServerException(status);
}
@@ -242,7 +242,7 @@ public abstract class Request {
protected String getServerErrorMessage() {
return NLS.bind(CVSMessages.Command_serverError, new String[] { getDisplayText() });
}
- protected String getDisplayText() {
- return getRequestId();
- }
+ protected String getDisplayText() {
+ return getRequestId();
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
index 5cdef4c50..6a1827aba 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
@@ -83,39 +83,39 @@ public abstract class ResponseHandler {
}
if (! folder.isCVSFolder()) {
String repositoryRoot = session.getRepositoryRoot();
- String relativePath;
- if (repositoryDir.startsWith(repositoryRoot)) {
- // The repositoryDir is an absolute path
- relativePath = Util.getRelativePath(repositoryRoot, repositoryDir);
- } else {
- // The repositoryDir is already a relative path
- relativePath = repositoryDir;
- }
- IResource resource = folder.getIResource();
- if (resource != null) {
- IProject project = resource.getProject();
+ String relativePath;
+ if (repositoryDir.startsWith(repositoryRoot)) {
+ // The repositoryDir is an absolute path
+ relativePath = Util.getRelativePath(repositoryRoot, repositoryDir);
+ } else {
+ // The repositoryDir is already a relative path
+ relativePath = repositoryDir;
+ }
+ IResource resource = folder.getIResource();
+ if (resource != null) {
+ IProject project = resource.getProject();
if (project != null && project.isAccessible() && !CVSTeamProvider.isSharedWithCVS(project)) {
- // The project isn't shared but we are about to perform an operation on it.
- // we need to flag the project as shared so that the sync info management works
- CVSTeamProvider.markAsTempShare(project);
- }
- }
- try{
- folder.setFolderSyncInfo(new FolderSyncInfo(
+ // The project isn't shared but we are about to perform an operation on it.
+ // we need to flag the project as shared so that the sync info management works
+ CVSTeamProvider.markAsTempShare(project);
+ }
+ }
+ try{
+ folder.setFolderSyncInfo(new FolderSyncInfo(
relativePath,
session.getCVSRepositoryLocation().getLocation(false),
null, false));
- } catch (CVSException ex){
- IStatus status = ex.getStatus();
- if (status != null){
- if (status.getCode() == IResourceStatus.INVALID_VALUE){
- //if it's an invalid value, just ignore the exception (see Bug# 152053),
- //else throw it again
- } else {
- throw ex;
- }
- }
- }
+ } catch (CVSException ex){
+ IStatus status = ex.getStatus();
+ if (status != null){
+ if (status.getCode() == IResourceStatus.INVALID_VALUE){
+ //if it's an invalid value, just ignore the exception (see Bug# 152053),
+ //else throw it again
+ } else {
+ throw ex;
+ }
+ }
+ }
}
return folder;
}
@@ -127,13 +127,13 @@ public abstract class ResponseHandler {
IContainer container = (IContainer)mParent.getIResource();
if (container != null) {
try {
- // Create all the parents as need
- recreatePhantomFolders(mParent);
- } catch (CVSException e) {
- if (!handleInvalidResourceName(session, mParent, e)) {
- throw e;
- }
- }
+ // Create all the parents as need
+ recreatePhantomFolders(mParent);
+ } catch (CVSException e) {
+ if (!handleInvalidResourceName(session, mParent, e)) {
+ throw e;
+ }
+ }
}
}
return mParent;
@@ -159,32 +159,32 @@ public abstract class ResponseHandler {
return this;
}
- protected boolean handleInvalidResourceName(Session session, ICVSResource resource, CVSException e) {
- int code = e.getStatus().getCode();
- if (code == IResourceStatus.INVALID_VALUE
- || code == IResourceStatus.INVALID_RESOURCE_NAME
- || code == IResourceStatus.RESOURCE_NOT_FOUND
- || code == IResourceStatus.RESOURCE_EXISTS
- || code == IResourceStatus.RESOURCE_WRONG_TYPE
- || code == IResourceStatus.CASE_VARIANT_EXISTS
- || code == IResourceStatus.PATH_OCCUPIED) {
-
- try {
- IResource local = resource.getIResource();
- String path;
- if (local == null) {
- path = resource.getRepositoryRelativePath();
- } else {
- path = local.getFullPath().toString();
- }
- IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.INVALID_LOCAL_RESOURCE_PATH, NLS.bind(CVSMessages.ResponseHandler_0, new String[] { path, e.getMessage() }), e, session.getLocalRoot());
- session.handleResponseError(status);
- } catch (CVSException e1) {
- CVSProviderPlugin.log(e1);
- }
- return true;
- }
- return false;
- }
+ protected boolean handleInvalidResourceName(Session session, ICVSResource resource, CVSException e) {
+ int code = e.getStatus().getCode();
+ if (code == IResourceStatus.INVALID_VALUE
+ || code == IResourceStatus.INVALID_RESOURCE_NAME
+ || code == IResourceStatus.RESOURCE_NOT_FOUND
+ || code == IResourceStatus.RESOURCE_EXISTS
+ || code == IResourceStatus.RESOURCE_WRONG_TYPE
+ || code == IResourceStatus.CASE_VARIANT_EXISTS
+ || code == IResourceStatus.PATH_OCCUPIED) {
+
+ try {
+ IResource local = resource.getIResource();
+ String path;
+ if (local == null) {
+ path = resource.getRepositoryRelativePath();
+ } else {
+ path = local.getFullPath().toString();
+ }
+ IStatus status = new CVSStatus(IStatus.ERROR, CVSStatus.INVALID_LOCAL_RESOURCE_PATH, NLS.bind(CVSMessages.ResponseHandler_0, new String[] { path, e.getMessage() }), e, session.getLocalRoot());
+ session.handleResponseError(status);
+ } catch (CVSException e1) {
+ CVSProviderPlugin.log(e1);
+ }
+ return true;
+ }
+ return false;
+ }
}
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 4775d2979..f63b5fbe3 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
@@ -94,9 +94,9 @@ public class Session {
private Map responseHandlers;
// List of errors accumulated while the command is executing
- private List errors = new ArrayList();
-
- private Command currentCommand;
+ private List errors = new ArrayList();
+
+ private Command currentCommand;
/**
* Creates a new CVS session, initially in the CLOSED state.
@@ -760,14 +760,14 @@ public class Session {
}
size = Long.parseLong(sizeLine, 10);
} catch (NumberFormatException e) {
- // In some cases, the server will give us an error line here
- if (sizeLine != null && sizeLine.startsWith("E")) { //$NON-NLS-1$
- handleErrorLine(sizeLine.substring(1).trim(), org.eclipse.core.runtime.Status.OK_STATUS);
- return;
- } else {
- IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,CVSMessages.Session_badInt, e, localRoot);
- throw new CVSException(status);
- }
+ // In some cases, the server will give us an error line here
+ if (sizeLine != null && sizeLine.startsWith("E")) { //$NON-NLS-1$
+ handleErrorLine(sizeLine.substring(1).trim(), org.eclipse.core.runtime.Status.OK_STATUS);
+ return;
+ } else {
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,CVSMessages.Session_badInt, e, localRoot);
+ throw new CVSException(status);
+ }
}
// create an input stream that spans the next 'size' bytes from the connection
InputStream in = new SizeConstrainedInputStream(connection.getInputStream(), size, true /*discardOnClose*/);
@@ -808,7 +808,7 @@ public class Session {
file.setContents(in, responseType, true, new NullProgressMonitor());
}
- /**
+ /**
* Stores the value of the last Mod-time response encountered.
* Valid only for the duration of a single CVS command.
*/
@@ -993,53 +993,53 @@ public class Session {
return (ResponseHandler)getReponseHandlers().get(responseID);
}
- /**
- * Accumulate the added errors so they can be included in the status returned
- * when the command execution is finished. OK status are ignored.
- * @param status the status to be accumulated
- */
- public void addError(IStatus status) {
- if (!status.isOK())
- errors.add(status);
- }
-
- public boolean hasErrors() {
- return !errors.isEmpty();
- }
-
- public IStatus[] getErrors() {
- return (IStatus[]) errors.toArray(new IStatus[errors.size()]);
- }
+ /**
+ * Accumulate the added errors so they can be included in the status returned
+ * when the command execution is finished. OK status are ignored.
+ * @param status the status to be accumulated
+ */
+ public void addError(IStatus status) {
+ if (!status.isOK())
+ errors.add(status);
+ }
+
+ public boolean hasErrors() {
+ return !errors.isEmpty();
+ }
+
+ public IStatus[] getErrors() {
+ return (IStatus[]) errors.toArray(new IStatus[errors.size()]);
+ }
- public void clearErrors() {
- errors.clear();
- }
+ public void clearErrors() {
+ errors.clear();
+ }
- public void setCurrentCommand(Command c) {
- currentCommand = c;
- }
-
- public Command getCurrentCommand() {
- return currentCommand;
- }
+ public void setCurrentCommand(Command c) {
+ currentCommand = c;
+ }
+
+ public Command getCurrentCommand() {
+ return currentCommand;
+ }
/**
* Report the given error line to any listeners
- * @param line the error line
- * @param status the status that indicates any problems encountered parsing the line
- */
- public void handleErrorLine(String line, IStatus status) {
- ConsoleListeners.getInstance().errorLineReceived(this, line, status);
- }
-
- /**
- * An error has occurred while processing responses from the
- * server. Place this error is the status that will be returned
- * from the command and show the error in the console
- * @param status the status that descibes the error
- */
- public void handleResponseError(IStatus status) {
- addError(status);
- handleErrorLine(NLS.bind(CVSMessages.Session_0, new String[] { status.getMessage() }), status);
- }
+ * @param line the error line
+ * @param status the status that indicates any problems encountered parsing the line
+ */
+ public void handleErrorLine(String line, IStatus status) {
+ ConsoleListeners.getInstance().errorLineReceived(this, line, status);
+ }
+
+ /**
+ * An error has occurred while processing responses from the
+ * server. Place this error is the status that will be returned
+ * from the command and show the error in the console
+ * @param status the status that descibes the error
+ */
+ public void handleResponseError(IStatus status) {
+ addError(status);
+ handleErrorLine(NLS.bind(CVSMessages.Session_0, new String[] { status.getMessage() }), status);
+ }
}
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 c8335c6b0..59c21d149 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
@@ -61,20 +61,20 @@ class StaticHandler extends ResponseHandler {
Assert.isTrue(repositoryDir.endsWith("/")); //$NON-NLS-1$
repositoryDir = repositoryDir.substring(0, repositoryDir.length() - 1);
try {
- ICVSFolder folder = createFolder(session, localDir, repositoryDir);
- FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
- // Added to ignore sync info for workspace root
- if (syncInfo == null) return;
- MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
- newInfo.setStatic(setStaticDirectory);
- // only set the sync info if it has changed
- if (!syncInfo.equals(newInfo))
- folder.setFolderSyncInfo(newInfo);
- } catch (CVSException e) {
- if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
- throw e;
- }
- }
+ ICVSFolder folder = createFolder(session, localDir, repositoryDir);
+ FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
+ // Added to ignore sync info for workspace root
+ if (syncInfo == null) return;
+ MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
+ newInfo.setStatic(setStaticDirectory);
+ // only set the sync info if it has changed
+ if (!syncInfo.equals(newInfo))
+ folder.setFolderSyncInfo(newInfo);
+ } catch (CVSException e) {
+ if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
+ throw e;
+ }
+ }
}
}
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 b94325e76..48fe582ff 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
@@ -66,24 +66,24 @@ class StickyHandler extends ResponseHandler {
Assert.isTrue(repositoryDir.endsWith("/")); //$NON-NLS-1$
repositoryDir = repositoryDir.substring(0, repositoryDir.length() - 1);
try {
- ICVSFolder folder = createFolder(session, localDir, repositoryDir);
- FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
- // Added to ignore sync info for workspace root
- if (syncInfo == null) return;
- MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
- newInfo.setTag(tag != null ? new CVSEntryLineTag(tag) : null);
- /* if we are reverting to BASE we do not change anything here
- * see bug 106876 */
- if(tag != null && tag.equals("TBASE")) //$NON-NLS-1$
- newInfo.setTag(syncInfo.getTag());
- // only set the sync info if it has changed
- if (!syncInfo.equals(newInfo))
- folder.setFolderSyncInfo(newInfo);
- } catch (CVSException e) {
- if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
- throw e;
- }
- }
+ ICVSFolder folder = createFolder(session, localDir, repositoryDir);
+ FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
+ // Added to ignore sync info for workspace root
+ if (syncInfo == null) return;
+ MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
+ newInfo.setTag(tag != null ? new CVSEntryLineTag(tag) : null);
+ /* if we are reverting to BASE we do not change anything here
+ * see bug 106876 */
+ if(tag != null && tag.equals("TBASE")) //$NON-NLS-1$
+ newInfo.setTag(syncInfo.getTag());
+ // only set the sync info if it has changed
+ if (!syncInfo.equals(newInfo))
+ folder.setFolderSyncInfo(newInfo);
+ } catch (CVSException e) {
+ if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
+ throw e;
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
index 7bc529dc1..385559125 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/SyncUpdate.java
@@ -22,26 +22,26 @@ public class SyncUpdate extends Update {
public SyncUpdate() { };
@Override
- protected void sendFileStructure(Session session, ICVSResource[] resources,
- LocalOption[] localOptions, boolean emptyFolders, IProgressMonitor monitor) throws CVSException {
+ protected void sendFileStructure(Session session, ICVSResource[] resources,
+ LocalOption[] localOptions, boolean emptyFolders, IProgressMonitor monitor) throws CVSException {
checkResourcesManaged(session, resources);
new FileStructureVisitor(session, localOptions, emptyFolders, true, false).visit(session, resources, monitor);
}
- @Override
- protected boolean isWorkspaceModification() {
- // The sync-update will not modify the workspace
- return false;
- }
-
- @Override
- protected GlobalOption[] filterGlobalOptions(Session session, GlobalOption[] globalOptions) {
- // Ensure that the DO_NOT_CHANGE (-n) global option is present
+ @Override
+ protected boolean isWorkspaceModification() {
+ // The sync-update will not modify the workspace
+ return false;
+ }
+
+ @Override
+ protected GlobalOption[] filterGlobalOptions(Session session, GlobalOption[] globalOptions) {
+ // Ensure that the DO_NOT_CHANGE (-n) global option is present
if (! Command.DO_NOT_CHANGE.isElementOf(globalOptions)) {
globalOptions = Command.DO_NOT_CHANGE.addToEnd(globalOptions);
}
- return super.filterGlobalOptions(session, globalOptions);
- }
+ return super.filterGlobalOptions(session, globalOptions);
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
index 9c99a9a0f..dd7783fac 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TemplateHandler.java
@@ -40,18 +40,18 @@ public class TemplateHandler extends ResponseHandler {
@Override
public void handle(Session session, String localDir, IProgressMonitor monitor) throws CVSException {
session.readLine(); /* read the remote dir which is not needed */
- // Only read the template file if the container exists.
- // This is OK as we only use the template from the project folder which must exist
- ICVSFolder localFolder = session.getLocalRoot().getFolder(localDir);
+ // Only read the template file if the container exists.
+ // This is OK as we only use the template from the project folder which must exist
+ ICVSFolder localFolder = session.getLocalRoot().getFolder(localDir);
IContainer container = (IContainer)localFolder.getIResource();
ICVSStorage templateFile = null;
if (container != null && container.exists()) {
- try {
- templateFile = CVSWorkspaceRoot.getCVSFileFor(SyncFileWriter.getTemplateFile(container));
- } catch (CVSException e) {
- // Log the inability to create the template file
- CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, "Could not write template file in " + container.getFullPath() + ": " + e.getMessage(), e, session.getLocalRoot())); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ try {
+ templateFile = CVSWorkspaceRoot.getCVSFileFor(SyncFileWriter.getTemplateFile(container));
+ } catch (CVSException e) {
+ // Log the inability to create the template file
+ CVSProviderPlugin.log(new CVSStatus(IStatus.ERROR, CVSStatus.ERROR, "Could not write template file in " + container.getFullPath() + ": " + e.getMessage(), e, session.getLocalRoot())); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
if (container == null || templateFile == null) {
// Create a dummy storage handle to recieve the contents from the server
@@ -98,12 +98,12 @@ public class TemplateHandler extends ResponseHandler {
};
}
try {
- session.receiveFile(templateFile, false, UpdatedHandler.HANDLE_UPDATED, monitor);
- } catch (CVSException e) {
- if (!(templateFile instanceof ICVSFile && handleInvalidResourceName(session, (ICVSFile)templateFile, e))) {
- throw e;
- }
- }
+ session.receiveFile(templateFile, false, UpdatedHandler.HANDLE_UPDATED, monitor);
+ } catch (CVSException e) {
+ if (!(templateFile instanceof ICVSFile && handleInvalidResourceName(session, (ICVSFile)templateFile, e))) {
+ throw e;
+ }
+ }
}
}
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 a03b0604e..cb0e5daa5 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
@@ -171,9 +171,9 @@ public class Update extends Command {
folder = resources[i].getParent();
}
if (folder==null || (!folder.isCVSFolder() && folder.exists())) {
- if (folder == null)
- folder = (ICVSFolder)resources[i];
- IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }),session.getLocalRoot());
+ if (folder == null)
+ folder = (ICVSFolder)resources[i];
+ IStatus status = new CVSStatus(IStatus.ERROR,CVSStatus.ERROR,NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }),session.getLocalRoot());
throw new CVSException(status);
}
}
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 efd121cbf..0b96cd76e 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
@@ -92,27 +92,27 @@ public class UpdatedHandler extends ResponseHandler {
boolean executable = permissionsLine.indexOf(EXECUTE_FLAG) != -1;
try {
- // The file may have been set as read-only by a previous checkout/update
- if (mFile.isReadOnly()) mFile.setReadOnly(false);
- } catch (CVSException e) {
- // Just log and keep going
- CVSProviderPlugin.log(e);
- }
+ // The file may have been set as read-only by a previous checkout/update
+ if (mFile.isReadOnly()) mFile.setReadOnly(false);
+ } catch (CVSException e) {
+ // Just log and keep going
+ CVSProviderPlugin.log(e);
+ }
try {
- receiveTargetFile(session, mFile, entryLine, modTime, binary, readOnly, executable, monitor);
- } catch (CVSException e) {
- // An error occurred while recieving the file.
- // If it is due to an invalid file name,
- // accumulate the error and continue.
- // Otherwise, exit
- if (!handleInvalidResourceName(session, mFile, e)) {
- throw e;
- }
- }
+ receiveTargetFile(session, mFile, entryLine, modTime, binary, readOnly, executable, monitor);
+ } catch (CVSException e) {
+ // An error occurred while recieving the file.
+ // If it is due to an invalid file name,
+ // accumulate the error and continue.
+ // Otherwise, exit
+ if (!handleInvalidResourceName(session, mFile, e)) {
+ throw e;
+ }
+ }
}
- protected ICVSFile getTargetFile(ICVSFolder mParent, String fileName, byte[] entryBytes) throws CVSException {
+ protected ICVSFile getTargetFile(ICVSFolder mParent, String fileName, byte[] entryBytes) throws CVSException {
return mParent.getFile(fileName);
}
@@ -148,12 +148,12 @@ public class UpdatedHandler extends ResponseHandler {
}
mFile.setSyncInfo(newInfoWithTimestamp, modificationState);
try {
- if (readOnly) mFile.setReadOnly(true);
+ if (readOnly) mFile.setReadOnly(true);
if (executable) mFile.setExecutable(true);
- } catch (CVSException e) {
- // Just log and keep going
- CVSProviderPlugin.log(e);
- }
+ } catch (CVSException e) {
+ // Just log and keep going
+ CVSProviderPlugin.log(e);
+ }
}
public int getHandlerType() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
index 388182224..282c736ad 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
@@ -70,13 +70,13 @@ public class Version extends RemoteCommand {
if (knownPrefix != null) {
String versionNumber = line.substring(knownPrefix.length(), line.indexOf(' ', knownPrefix.length() + 1));
if (versionNumber.startsWith("1.10") || versionNumber.equals("1.11") || versionNumber.equals("1.11.1")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- serverType = CVSRepositoryLocation.UNSUPPORTED_SERVER;
+ serverType = CVSRepositoryLocation.UNSUPPORTED_SERVER;
status = new CVSStatus(IStatus.WARNING, CVSStatus.UNSUPPORTED_SERVER_VERSION, NLS.bind(CVSMessages.Version_unsupportedVersion, new String[] { location.getHost(), versionNumber }),location);
} else if (isCVSNT) {
- serverType = CVSRepositoryLocation.CVSNT_SERVER;
+ serverType = CVSRepositoryLocation.CVSNT_SERVER;
}
} else {
- serverType = CVSRepositoryLocation.UNKNOWN_SERVER;
+ serverType = CVSRepositoryLocation.UNKNOWN_SERVER;
status = new CVSStatus(IStatus.INFO, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_unknownVersionFormat, new String[] { location.getHost(), line }), location);
}
((CVSRepositoryLocation)location).setServerPlaform(serverType);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AdminKSubstListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AdminKSubstListener.java
index 286d30487..b7d70eff6 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AdminKSubstListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/AdminKSubstListener.java
@@ -80,7 +80,7 @@ public class AdminKSubstListener extends CommandOutputListener {
IPath relativeFilePath = rcsFilePath.removeFirstSegments(remoteRootPath.segmentCount());
ICVSFile file = commandRoot.getFile(relativeFilePath.toString());
if (file.isManaged() && isMatchingPath(file, rcsFilePath)) {
- return file;
+ return file;
}
}
@@ -90,7 +90,7 @@ public class AdminKSubstListener extends CommandOutputListener {
if (parent != null) {
ICVSFile file = parent.getFile(rcsFilePath.lastSegment());
if (file.isManaged()) {
- return file;
+ return file;
}
}
@@ -99,30 +99,30 @@ public class AdminKSubstListener extends CommandOutputListener {
NLS.bind(CVSMessages.AdminKSubstListener_expectedChildOfCommandRoot, new String[] { rcsFilePath.toString(), remoteRootPath.toString() })));
}
- private ICVSFolder findFolder(ICVSFolder commandRoot, IPath path) throws CVSException {
- final String remotePath = path.toString();
- final ICVSFolder[] result = new ICVSFolder[] { null };
- commandRoot.accept(new ICVSResourceVisitor() {
- public void visitFile(ICVSFile file) throws CVSException {
- // Nothing to do for files
- }
- public void visitFolder(ICVSFolder folder) throws CVSException {
- FolderSyncInfo info = folder.getFolderSyncInfo();
- if (info != null && info.getRemoteLocation().equals(remotePath)) {
- // We found the folder we're looking for
- result[0] = folder;
- }
- if (result[0] == null) {
- folder.acceptChildren(this);
- }
- }
- });
- return result[0];
- }
+ private ICVSFolder findFolder(ICVSFolder commandRoot, IPath path) throws CVSException {
+ final String remotePath = path.toString();
+ final ICVSFolder[] result = new ICVSFolder[] { null };
+ commandRoot.accept(new ICVSResourceVisitor() {
+ public void visitFile(ICVSFile file) throws CVSException {
+ // Nothing to do for files
+ }
+ public void visitFolder(ICVSFolder folder) throws CVSException {
+ FolderSyncInfo info = folder.getFolderSyncInfo();
+ if (info != null && info.getRemoteLocation().equals(remotePath)) {
+ // We found the folder we're looking for
+ result[0] = folder;
+ }
+ if (result[0] == null) {
+ folder.acceptChildren(this);
+ }
+ }
+ });
+ return result[0];
+ }
- private boolean isMatchingPath(ICVSFile file, IPath rcsFilePath) throws CVSException {
- FolderSyncInfo info = file.getParent().getFolderSyncInfo();
- return info != null
- && info.getRemoteLocation().equals(rcsFilePath.removeLastSegments(1).toString());
- }
+ private boolean isMatchingPath(ICVSFile file, IPath rcsFilePath) throws CVSException {
+ FolderSyncInfo info = file.getParent().getFolderSyncInfo();
+ return info != null
+ && info.getRemoteLocation().equals(rcsFilePath.removeLastSegments(1).toString());
+ }
}
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 dc277e4e7..b9408f4b7 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
@@ -32,7 +32,7 @@ public class AnnotateListener extends CommandOutputListener {
int lineNumber;
public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
- String error = null;
+ String error = null;
CVSAnnotateBlock aBlock = new CVSAnnotateBlock(line, lineNumber++);
if (!aBlock.isValid()) {
error = line;
@@ -49,8 +49,8 @@ public class AnnotateListener extends CommandOutputListener {
} catch (IOException e) {
}
add(aBlock);
- if (error != null)
- return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, error, commandRoot);
+ if (error != null)
+ return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, error, commandRoot);
return OK;
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
index 55e09f61c..0660b6dc2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
@@ -51,8 +51,8 @@ public class DiffListener extends CommandOutputListener {
// Special handling to avoid getting duplicate CRs when generating a patch on windows.
// If the remote file has CR/LF in it, then the line will have a CR at the end.
- // We need to remove it so we don't end up with two CRs (since the printStream will also add one).
- // On *nix, we want to include the CR since it will not be added by the printStream (see bug 92162).
+ // We need to remove it so we don't end up with two CRs (since the printStream will also add one).
+ // On *nix, we want to include the CR since it will not be added by the printStream (see bug 92162).
if (Session.IS_CRLF_PLATFORM && line.length() > 0 && line.charAt(line.length() - 1) == '\r') {
line = line.substring(0, line.length() - 1);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ILogEntryListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ILogEntryListener.java
index b0ccb4b18..577709c47 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ILogEntryListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ILogEntryListener.java
@@ -20,10 +20,10 @@ import org.eclipse.team.internal.ccvs.core.ILogEntry;
*/
public interface ILogEntryListener {
- /**
- * A log entry was received for the current file
- * @param entry the received log entry.
- */
- void handleLogEntryReceived(ILogEntry entry);
-
+ /**
+ * A log entry was received for the current file
+ * @param entry the received log entry.
+ */
+ void handleLogEntryReceived(ILogEntry entry);
+
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogEntry.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogEntry.java
index 6c88f1fcf..09f28da16 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogEntry.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogEntry.java
@@ -30,8 +30,8 @@ public class LogEntry extends PlatformObject implements ILogEntry {
private String state;
private CVSTag[] tags;
private CVSTag[] branches;
- private String[] revisions;
-
+ private String[] revisions;
+
/*
* Flatten the text in the multi-line comment
*/
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 6c3d2806b..6d199da8c 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
@@ -33,233 +33,233 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
* server but delegates the handling of the entries to a subclass.
*/
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;
- private final DateFormat LOG_DATE_FORMATTER_OLD = new SimpleDateFormat(LOG_TIMESTAMP_FORMAT_OLD, LOG_TIMESTAMP_LOCALE);
- private final DateFormat LOG_DATE_FORMATTER = new SimpleDateFormat(LOG_TIMESTAMP_FORMAT, LOG_TIMESTAMP_LOCALE);
-
- // Server message prefix used for error detection
- private static final String NOTHING_KNOWN_ABOUT = "nothing known about "; //$NON-NLS-1$
+
+ /*
+ * 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 final DateFormat LOG_DATE_FORMATTER_OLD = new SimpleDateFormat(LOG_TIMESTAMP_FORMAT_OLD, LOG_TIMESTAMP_LOCALE);
+ private final DateFormat LOG_DATE_FORMATTER = new SimpleDateFormat(LOG_TIMESTAMP_FORMAT, LOG_TIMESTAMP_LOCALE);
+
+ // Server message prefix used for error detection
+ private static final String NOTHING_KNOWN_ABOUT = "nothing known about "; //$NON-NLS-1$
- // States of log accumulation.
- private final int DONE = 4;
- private final int COMMENT = 3;
- private final int REVISION = 2;
- private final int SYMBOLIC_NAMES = 1;
- private final int BEGIN = 0;
-
- //Tag used for accumulating all of a branch's revision info
- public final static String BRANCH_REVISION = "branchRevision"; //$NON-NLS-1$
-
- private static final CVSTag[] NO_TAGS = new CVSTag[0];
- private static final String[] NO_VERSIONS = new String[0];
-
- // Instance variables for accumulating Log information
- private RemoteFile currentFile;
- private int state = BEGIN;
- private StringBuffer comment;
- private String fileState;
- private String revision;
- private String author;
- private Date creationDate;
- private List versions = new ArrayList();
- private Map internedStrings = new HashMap();
- private final ILogEntryListener listener;
-
- /**
- * Create a log listener for receiving entries for one or more files.
- */
- public LogListener(ILogEntryListener listener) {
- this.listener = listener;
- }
+ // States of log accumulation.
+ private final int DONE = 4;
+ private final int COMMENT = 3;
+ private final int REVISION = 2;
+ private final int SYMBOLIC_NAMES = 1;
+ private final int BEGIN = 0;
+
+ //Tag used for accumulating all of a branch's revision info
+ public final static String BRANCH_REVISION = "branchRevision"; //$NON-NLS-1$
+
+ private static final CVSTag[] NO_TAGS = new CVSTag[0];
+ private static final String[] NO_VERSIONS = new String[0];
+
+ // Instance variables for accumulating Log information
+ private RemoteFile currentFile;
+ private int state = BEGIN;
+ private StringBuffer comment;
+ private String fileState;
+ private String revision;
+ private String author;
+ private Date creationDate;
+ private List versions = new ArrayList();
+ private Map internedStrings = new HashMap();
+ private final ILogEntryListener listener;
+
+ /**
+ * Create a log listener for receiving entries for one or more files.
+ */
+ public LogListener(ILogEntryListener listener) {
+ this.listener = listener;
+ }
- public LogListener(RemoteFile file, ILogEntryListener listener) {
- this(listener);
- this.currentFile = file;
- }
+ public LogListener(RemoteFile file, ILogEntryListener listener) {
+ this(listener);
+ this.currentFile = file;
+ }
- private String getRelativeFilePath(ICVSRepositoryLocation location, String fileName) {
- if (fileName.endsWith(",v")) { //$NON-NLS-1$
- fileName = fileName.substring(0, fileName.length() - 2);
- }
- fileName = Util.removeAtticSegment(fileName);
- String rootDirectory = location.getRootDirectory();
- if (fileName.startsWith(rootDirectory)) {
- try {
- fileName = Util.getRelativePath(rootDirectory, fileName);
- } catch (CVSException e) {
- CVSProviderPlugin.log(e);
- return null;
- }
- }
- return fileName;
- }
+ private String getRelativeFilePath(ICVSRepositoryLocation location, String fileName) {
+ if (fileName.endsWith(",v")) { //$NON-NLS-1$
+ fileName = fileName.substring(0, fileName.length() - 2);
+ }
+ fileName = Util.removeAtticSegment(fileName);
+ String rootDirectory = location.getRootDirectory();
+ if (fileName.startsWith(rootDirectory)) {
+ try {
+ fileName = Util.getRelativePath(rootDirectory, fileName);
+ } catch (CVSException e) {
+ CVSProviderPlugin.log(e);
+ return null;
+ }
+ }
+ return fileName;
+ }
- public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
- String serverMessage = getServerMessage(line, location);
- if (serverMessage != null) {
- // look for the following condition
- // E cvs server: nothing known about fileName
- if (serverMessage.startsWith(NOTHING_KNOWN_ABOUT)) {
- return new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, line, commandRoot);
- }
- }
- return OK;
- }
+ public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
+ String serverMessage = getServerMessage(line, location);
+ if (serverMessage != null) {
+ // look for the following condition
+ // E cvs server: nothing known about fileName
+ if (serverMessage.startsWith(NOTHING_KNOWN_ABOUT)) {
+ return new CVSStatus(IStatus.ERROR, CVSStatus.DOES_NOT_EXIST, line, commandRoot);
+ }
+ }
+ return OK;
+ }
- public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
- // Fields we will find in the log for a file
- // keys = String (tag name), values = String (tag revision number) */
- switch (state) {
- case BEGIN:
- if (line.startsWith("RCS file: ")) { //$NON-NLS-1$
- // We are starting to recieve the log for a file
- String fileName = getRelativeFilePath(location, line.substring(10).trim());
- if (fileName == null) {
- currentFile = null;
- handleInvalidFileName(location, fileName);
- } else {
- if (currentFile == null || !currentFile.getRepositoryRelativePath().equals(fileName)) {
- // We are starting another file
- beginFile(location, fileName);
- }
- }
- } else if (line.startsWith("symbolic names:")) { //$NON-NLS-1$
- state = SYMBOLIC_NAMES;
- } else if (line.startsWith("revision ")) { //$NON-NLS-1$
- // if the revision has been locked, remove the "locked by" suffix
- revision = line.substring(9).replaceFirst(ResourceSyncInfo.LOCKEDBY_REGEX, ""); //$NON-NLS-1$
- revision = internAndCopyString(revision);
- state = REVISION;
- } else if (line.startsWith("total revisions:")){ //$NON-NLS-1$
- //if there are no current revision selected and this is a branch then we are in the
- //case where there have been no changes made on the branch since the initial branching
- //and we need to get the revision that the branch was made from
- int indexOfSelectedRevisions = line.lastIndexOf("selected revisions: "); //$NON-NLS-1$
- //20 for length of "selected revisions: "
- String selectedRevisions = line.substring(indexOfSelectedRevisions + 20).trim();
- if (selectedRevisions.equals("0")){ //$NON-NLS-1$
- //ok put into comment state to await ======= and add info to log
- state = COMMENT;
- revision = BRANCH_REVISION;
- comment = new StringBuffer();
- }
- }
- break;
- case SYMBOLIC_NAMES:
- if (line.startsWith("keyword substitution:")) { //$NON-NLS-1$
- state = BEGIN;
- } else {
- int firstColon = line.indexOf(':');
- String tagName = internAndCopyString(line.substring(1, firstColon));
- String tagRevision = internAndCopyString(line.substring(firstColon + 2));
- versions.add(new VersionInfo(tagRevision, tagName));
- }
- break;
- case REVISION:
- // date: 2000/06/19 04:56:21; author: somebody; state: Exp; lines: +114 -45
- // get the creation date
- int endOfDateIndex = line.indexOf(';', 6);
- creationDate = convertFromLogTime(line.substring(6, endOfDateIndex) + " GMT"); //$NON-NLS-1$
-
- // get the author name
- int endOfAuthorIndex = line.indexOf(';', endOfDateIndex + 1);
- author = internAndCopyString(line.substring(endOfDateIndex + 11, endOfAuthorIndex));
+ public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
+ // Fields we will find in the log for a file
+ // keys = String (tag name), values = String (tag revision number) */
+ switch (state) {
+ case BEGIN:
+ if (line.startsWith("RCS file: ")) { //$NON-NLS-1$
+ // We are starting to recieve the log for a file
+ String fileName = getRelativeFilePath(location, line.substring(10).trim());
+ if (fileName == null) {
+ currentFile = null;
+ handleInvalidFileName(location, fileName);
+ } else {
+ if (currentFile == null || !currentFile.getRepositoryRelativePath().equals(fileName)) {
+ // We are starting another file
+ beginFile(location, fileName);
+ }
+ }
+ } else if (line.startsWith("symbolic names:")) { //$NON-NLS-1$
+ state = SYMBOLIC_NAMES;
+ } else if (line.startsWith("revision ")) { //$NON-NLS-1$
+ // if the revision has been locked, remove the "locked by" suffix
+ revision = line.substring(9).replaceFirst(ResourceSyncInfo.LOCKEDBY_REGEX, ""); //$NON-NLS-1$
+ revision = internAndCopyString(revision);
+ state = REVISION;
+ } else if (line.startsWith("total revisions:")){ //$NON-NLS-1$
+ //if there are no current revision selected and this is a branch then we are in the
+ //case where there have been no changes made on the branch since the initial branching
+ //and we need to get the revision that the branch was made from
+ int indexOfSelectedRevisions = line.lastIndexOf("selected revisions: "); //$NON-NLS-1$
+ //20 for length of "selected revisions: "
+ String selectedRevisions = line.substring(indexOfSelectedRevisions + 20).trim();
+ if (selectedRevisions.equals("0")){ //$NON-NLS-1$
+ //ok put into comment state to await ======= and add info to log
+ state = COMMENT;
+ revision = BRANCH_REVISION;
+ comment = new StringBuffer();
+ }
+ }
+ break;
+ case SYMBOLIC_NAMES:
+ if (line.startsWith("keyword substitution:")) { //$NON-NLS-1$
+ state = BEGIN;
+ } else {
+ int firstColon = line.indexOf(':');
+ String tagName = internAndCopyString(line.substring(1, firstColon));
+ String tagRevision = internAndCopyString(line.substring(firstColon + 2));
+ versions.add(new VersionInfo(tagRevision, tagName));
+ }
+ break;
+ case REVISION:
+ // date: 2000/06/19 04:56:21; author: somebody; state: Exp; lines: +114 -45
+ // get the creation date
+ int endOfDateIndex = line.indexOf(';', 6);
+ creationDate = convertFromLogTime(line.substring(6, endOfDateIndex) + " GMT"); //$NON-NLS-1$
+
+ // get the author name
+ int endOfAuthorIndex = line.indexOf(';', endOfDateIndex + 1);
+ author = internAndCopyString(line.substring(endOfDateIndex + 11, endOfAuthorIndex));
- // get the file state (because this revision might be "dead")
- int endOfStateIndex = line.indexOf(';', endOfAuthorIndex + 1) < 0 ? line.length() : line.indexOf(';', endOfAuthorIndex + 1);
- fileState = internAndCopyString(line.substring(endOfAuthorIndex + 10, endOfStateIndex));
- comment = new StringBuffer();
- state = COMMENT;
- break;
- case COMMENT:
- // skip next line (info about branches) if it exists, if not then it is a comment line.
- if (line.startsWith("branches:")) break; //$NON-NLS-1$
- if (line.equals("=============================================================================") //$NON-NLS-1$
- || line.equals("----------------------------")) { //$NON-NLS-1$
- state = DONE;
- break;
- }
- //check for null if we are in the waiting to finish case (brought on by branches)
- if (comment == null)
- break;
-
- if (comment.length() != 0) comment.append('\n');
- comment.append(line);
- break;
- }
- if (state == DONE) {
- // we are only interested in tag names for this revision, remove all others.
- List thisRevisionTags = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
- List thisRevisionBranches = new ArrayList(1);
- //a parallel lists for revision tags (used only for branches with no commits on them)
- List revisionVersions = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
- String branchRevision = this.getBranchRevision(revision);
- for (Iterator i = versions.iterator(); i.hasNext();) {
- VersionInfo version = (VersionInfo) i.next();
- String tagName = version.getTagName();
- String tagRevision = version.getTagRevision();
- String tagBranchRevision = version.getBranchRevision();
+ // get the file state (because this revision might be "dead")
+ int endOfStateIndex = line.indexOf(';', endOfAuthorIndex + 1) < 0 ? line.length() : line.indexOf(';', endOfAuthorIndex + 1);
+ fileState = internAndCopyString(line.substring(endOfAuthorIndex + 10, endOfStateIndex));
+ comment = new StringBuffer();
+ state = COMMENT;
+ break;
+ case COMMENT:
+ // skip next line (info about branches) if it exists, if not then it is a comment line.
+ if (line.startsWith("branches:")) break; //$NON-NLS-1$
+ if (line.equals("=============================================================================") //$NON-NLS-1$
+ || line.equals("----------------------------")) { //$NON-NLS-1$
+ state = DONE;
+ break;
+ }
+ //check for null if we are in the waiting to finish case (brought on by branches)
+ if (comment == null)
+ break;
+
+ if (comment.length() != 0) comment.append('\n');
+ comment.append(line);
+ break;
+ }
+ if (state == DONE) {
+ // we are only interested in tag names for this revision, remove all others.
+ List thisRevisionTags = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
+ List thisRevisionBranches = new ArrayList(1);
+ //a parallel lists for revision tags (used only for branches with no commits on them)
+ List revisionVersions = versions.isEmpty() ? Collections.EMPTY_LIST : new ArrayList(3);
+ String branchRevision = this.getBranchRevision(revision);
+ for (Iterator i = versions.iterator(); i.hasNext();) {
+ VersionInfo version = (VersionInfo) i.next();
+ String tagName = version.getTagName();
+ String tagRevision = version.getTagRevision();
+ String tagBranchRevision = version.getBranchRevision();
int type = version.isBranch() ? CVSTag.BRANCH : CVSTag.VERSION;
if ( branchRevision.equals(tagBranchRevision) ||
(version.isBranch() && revision.equals(tagRevision))) {
- CVSTag cvsTag = new CVSTag(tagName, tagBranchRevision, type);
- thisRevisionBranches.add(cvsTag);
- }
-
+ CVSTag cvsTag = new CVSTag(tagName, tagBranchRevision, type);
+ thisRevisionBranches.add(cvsTag);
+ }
+
if (tagRevision.equals(revision) ||
- revision.equals(BRANCH_REVISION)) {
- CVSTag cvsTag = new CVSTag(tagName, tagBranchRevision, type);
- thisRevisionTags.add(cvsTag);
- if (revision.equals(BRANCH_REVISION)){
- //also record the tag revision
- revisionVersions.add(tagRevision);
- }
- }
- }
-
- if (branchRevision.equals(CVSTag.HEAD_REVISION)) {
- CVSTag tag = new CVSTag(CVSTag.HEAD_BRANCH, CVSTag.HEAD_REVISION, CVSTag.HEAD);
+ revision.equals(BRANCH_REVISION)) {
+ CVSTag cvsTag = new CVSTag(tagName, tagBranchRevision, type);
+ thisRevisionTags.add(cvsTag);
+ if (revision.equals(BRANCH_REVISION)){
+ //also record the tag revision
+ revisionVersions.add(tagRevision);
+ }
+ }
+ }
+
+ if (branchRevision.equals(CVSTag.HEAD_REVISION)) {
+ CVSTag tag = new CVSTag(CVSTag.HEAD_BRANCH, CVSTag.HEAD_REVISION, CVSTag.HEAD);
thisRevisionBranches.add(tag);
- } else {
- if ( thisRevisionBranches.size() == 0) {
- CVSTag cvsTag = new CVSTag(CVSTag.UNKNOWN_BRANCH, branchRevision, CVSTag.BRANCH);
- thisRevisionBranches.add(cvsTag);
- }
- }
- if (currentFile != null) {
- LogEntry entry = new LogEntry(currentFile, revision, author, creationDate,
- internString(comment.toString()), fileState,
- !thisRevisionTags.isEmpty() ? (CVSTag[]) thisRevisionTags.toArray(new CVSTag[thisRevisionTags.size()]) :NO_TAGS,
- !thisRevisionBranches.isEmpty() ? (CVSTag[]) thisRevisionBranches.toArray(new CVSTag[thisRevisionBranches.size()]) :NO_TAGS,
- !revisionVersions.isEmpty() ? (String[]) revisionVersions.toArray(new String[revisionVersions.size()]) : NO_VERSIONS);
- addEntry(entry);
- }
- state = BEGIN;
- }
- return OK;
- }
+ } else {
+ if ( thisRevisionBranches.size() == 0) {
+ CVSTag cvsTag = new CVSTag(CVSTag.UNKNOWN_BRANCH, branchRevision, CVSTag.BRANCH);
+ thisRevisionBranches.add(cvsTag);
+ }
+ }
+ if (currentFile != null) {
+ LogEntry entry = new LogEntry(currentFile, revision, author, creationDate,
+ internString(comment.toString()), fileState,
+ !thisRevisionTags.isEmpty() ? (CVSTag[]) thisRevisionTags.toArray(new CVSTag[thisRevisionTags.size()]) :NO_TAGS,
+ !thisRevisionBranches.isEmpty() ? (CVSTag[]) thisRevisionBranches.toArray(new CVSTag[thisRevisionBranches.size()]) :NO_TAGS,
+ !revisionVersions.isEmpty() ? (String[]) revisionVersions.toArray(new String[revisionVersions.size()]) : NO_VERSIONS);
+ addEntry(entry);
+ }
+ state = BEGIN;
+ }
+ return OK;
+ }
- /**
- * Convert revision number to branch number.
- *
- * <table border="1">
- * <tr><th>revision</th><th>branch</th><th>comment</th></tr>
- * <tr><td>1.1.2.1</td><td>1.1.0.2</td><td>regular branch</td></tr>
- * <tr><td>1.1.4.1</td><td>1.1.0.4</td><td>regular branch</td></tr>
- * <tr><td>1.1.1.2</td><td>1.1.1</td><td>vendor branch</td></tr>
- * <tr><td>1.1.2.1.2.3</td><td>1.1.2.1.0.2</td><td>branch created from another branch</td></tr>
- * </table>
- *
- * @param revision revision number
- * @return branch number
- *
- */
+ /**
+ * Convert revision number to branch number.
+ *
+ * <table border="1">
+ * <tr><th>revision</th><th>branch</th><th>comment</th></tr>
+ * <tr><td>1.1.2.1</td><td>1.1.0.2</td><td>regular branch</td></tr>
+ * <tr><td>1.1.4.1</td><td>1.1.0.4</td><td>regular branch</td></tr>
+ * <tr><td>1.1.1.2</td><td>1.1.1</td><td>vendor branch</td></tr>
+ * <tr><td>1.1.2.1.2.3</td><td>1.1.2.1.0.2</td><td>branch created from another branch</td></tr>
+ * </table>
+ *
+ * @param revision revision number
+ * @return branch number
+ *
+ */
private String getBranchRevision(String revision) {
if (revision.length() == 0 || revision.lastIndexOf(".") == -1) //$NON-NLS-1$
throw new IllegalArgumentException(
@@ -274,63 +274,63 @@ public class LogListener extends CommandOutputListener {
branchPrefix += branchNumber.substring(branchNumber.lastIndexOf(".")); //$NON-NLS-1$
return branchPrefix;
}
-
- protected void beginFile(ICVSRepositoryLocation location, String fileName) {
- currentFile = RemoteFile.create(fileName, location);
- versions.clear();
- }
+
+ protected void beginFile(ICVSRepositoryLocation location, String fileName) {
+ currentFile = RemoteFile.create(fileName, location);
+ versions.clear();
+ }
- protected void addEntry(LogEntry entry) {
- listener.handleLogEntryReceived(entry);
- }
+ protected void addEntry(LogEntry entry) {
+ listener.handleLogEntryReceived(entry);
+ }
- protected void handleInvalidFileName(ICVSRepositoryLocation location, String badFilePath) {
- CVSProviderPlugin.log(IStatus.WARNING, "Invalid file path '" + badFilePath + "' received from " + location.toString(), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ protected void handleInvalidFileName(ICVSRepositoryLocation location, String badFilePath) {
+ CVSProviderPlugin.log(IStatus.WARNING, "Invalid file path '" + badFilePath + "' received from " + location.toString(), null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- /**
- * Converts a time stamp as sent from a cvs server for a "log" command into a
- * <code>Date</code>.
- */
- private Date convertFromLogTime(String modTime) {
- DateFormat format = LOG_DATE_FORMATTER;
- // Compatibility for older cvs version (pre 1.12.9)
- if (modTime.length() > 4 && modTime.charAt(4) == '/')
- format = LOG_DATE_FORMATTER_OLD;
-
- try {
- return format.parse(modTime);
- } catch (ParseException e) {
- // fallback is to return null
- return null;
- }
- }
-
- private String internAndCopyString(String string) {
- String internedString = (String) internedStrings.get(string);
- if (internedString == null) {
- internedString = new String(string);
- internedStrings.put(internedString, internedString);
- }
- return internedString;
- }
-
- private String internString(String string) {
- String internedString = (String) internedStrings.get(string);
- if (internedString == null) {
- internedString = string;
- internedStrings.put(internedString, internedString);
- }
- return internedString;
- }
-
- private static class VersionInfo {
+ /**
+ * Converts a time stamp as sent from a cvs server for a "log" command into a
+ * <code>Date</code>.
+ */
+ private Date convertFromLogTime(String modTime) {
+ DateFormat format = LOG_DATE_FORMATTER;
+ // Compatibility for older cvs version (pre 1.12.9)
+ if (modTime.length() > 4 && modTime.charAt(4) == '/')
+ format = LOG_DATE_FORMATTER_OLD;
+
+ try {
+ return format.parse(modTime);
+ } catch (ParseException e) {
+ // fallback is to return null
+ return null;
+ }
+ }
+
+ private String internAndCopyString(String string) {
+ String internedString = (String) internedStrings.get(string);
+ if (internedString == null) {
+ internedString = new String(string);
+ internedStrings.put(internedString, internedString);
+ }
+ return internedString;
+ }
+
+ private String internString(String string) {
+ String internedString = (String) internedStrings.get(string);
+ if (internedString == null) {
+ internedString = string;
+ internedStrings.put(internedString, internedString);
+ }
+ return internedString;
+ }
+
+ private static class VersionInfo {
private final boolean isBranch;
private String tagRevision;
private String branchRevision;
private final String tagName;
- public VersionInfo(String version, String tagName) {
+ public VersionInfo(String version, String tagName) {
this.tagName = tagName;
this.isBranch = isBranchTag(version);
tagRevision = version;
@@ -347,7 +347,7 @@ public class LogListener extends CommandOutputListener {
tagRevision = version.substring(0, lastDot);
}
}
- }
+ }
public String getTagName() {
return this.tagName;
@@ -356,34 +356,34 @@ public class LogListener extends CommandOutputListener {
public String getTagRevision() {
return this.tagRevision;
}
-
- public boolean isBranch() {
- return isBranch;
- }
-
- /** branch tags have odd number of segments or have
- * an even number with a zero as the second last segment
- * e.g: 1.1.1, 1.26.0.2 are branch revision numbers */
- private boolean isBranchTag(String tagName) {
- // First check if we have an odd number of segments (i.e. even number of dots)
- int numberOfDots = 0;
- int lastDot = 0;
- for (int i = 0; i < tagName.length(); i++) {
- if (tagName.charAt(i) == '.') {
- numberOfDots++;
- lastDot = i;
- }
- }
- if ((numberOfDots % 2) == 0) return true;
- if (numberOfDots == 1) return false;
-
- // If not, check if the second lat segment is a zero
- if (tagName.charAt(lastDot - 1) == '0' && tagName.charAt(lastDot - 2) == '.') return true;
- return false;
- }
+
+ public boolean isBranch() {
+ return isBranch;
+ }
+
+ /** branch tags have odd number of segments or have
+ * an even number with a zero as the second last segment
+ * e.g: 1.1.1, 1.26.0.2 are branch revision numbers */
+ private boolean isBranchTag(String tagName) {
+ // First check if we have an odd number of segments (i.e. even number of dots)
+ int numberOfDots = 0;
+ int lastDot = 0;
+ for (int i = 0; i < tagName.length(); i++) {
+ if (tagName.charAt(i) == '.') {
+ numberOfDots++;
+ lastDot = i;
+ }
+ }
+ if ((numberOfDots % 2) == 0) return true;
+ if (numberOfDots == 1) return false;
+
+ // If not, check if the second lat segment is a zero
+ if (tagName.charAt(lastDot - 1) == '0' && tagName.charAt(lastDot - 2) == '.') return true;
+ return false;
+ }
public String getBranchRevision() {
return branchRevision;
}
- }
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
index f1538dd52..849ab09c2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
@@ -238,9 +238,9 @@ public class UpdateListener extends CommandOutputListener {
if (resource != null) {
return new CVSStatus(IStatus.ERROR, CVSStatus.UNMEGERED_BINARY_CONFLICT,
NLS.bind(CVSMessages.UpdateListener_0, (new Object[] {
- resource.getFullPath().toString(),
- mergedBinaryFileRevision,
- resource.getFullPath().removeLastSegments(1).append(backupFile).toString()})), commandRoot);
+ resource.getFullPath().toString(),
+ mergedBinaryFileRevision,
+ resource.getFullPath().removeLastSegments(1).append(backupFile).toString()})), commandRoot);
}
}
} catch (CVSException e1) {
@@ -265,8 +265,8 @@ public class UpdateListener extends CommandOutputListener {
// To get the folders, the update request should be re-issued for HEAD
return new CVSStatus(IStatus.WARNING, CVSStatus.NO_SUCH_TAG, line, commandRoot);
} else if (message.startsWith("Numeric join") && message.endsWith("may not contain a date specifier")) { //$NON-NLS-1$ //$NON-NLS-2$
- // This error indicates a join failed because a date tag was used
- return super.errorLine(line, location, commandRoot, monitor);
+ // This error indicates a join failed because a date tag was used
+ return super.errorLine(line, location, commandRoot, monitor);
} else {
return super.errorLine(line, location, commandRoot, monitor);
}

Back to the top