diff options
author | Michael Valenta | 2002-01-22 19:07:29 +0000 |
---|---|---|
committer | Michael Valenta | 2002-01-22 19:07:29 +0000 |
commit | 0758b2ed6832fe874b9b381bd76aefce106505a6 (patch) | |
tree | 501df216a1db8f7b73777a932ef48573924d48b5 | |
parent | fb5ef71e27536b11a8e2f83350bfc17bb3051a52 (diff) | |
download | eclipse.platform.team-command_rework_branch.tar.gz eclipse.platform.team-command_rework_branch.tar.xz eclipse.platform.team-command_rework_branch.zip |
*** empty log message ***command_rework_branch
4 files changed, 34 insertions, 15 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java index d99a4040b..6bbefed64 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java @@ -164,7 +164,7 @@ public class CVSProvider implements ICVSProvider { if (CVSProviderPlugin.getPlugin().getPruneEmptyDirectories()) localOptions.add(Checkout.PRUNE_EMPTY_DIRECTORIES); // Add the options related to the CVSTag - if (tag != null) { + if (tag != null && tag.getType() != CVSTag.HEAD) { localOptions.add(Checkout.makeTagOption(tag)); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java index 5448ebfee..05e1a5841 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java @@ -45,6 +45,7 @@ import org.eclipse.team.internal.ccvs.core.client.Tag; import org.eclipse.team.internal.ccvs.core.client.Update; import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption; import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; +import org.eclipse.team.internal.ccvs.core.client.listeners.DiffListener; import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement; @@ -502,11 +503,11 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider { s.open(progress); try { status = Command.DIFF.execute(s, - Command.NO_GLOBAL_OPTIONS, - options, - arguments, - null, // FIXME new DiffListener(stream), - progress); + Command.NO_GLOBAL_OPTIONS, + options, + arguments, + new DiffListener(stream), + progress); } finally { s.close(); } 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 e9a069630..fded6332b 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 @@ -213,7 +213,7 @@ public abstract class Command { try { resources[i] = localRoot.getChild(arguments[i]); } catch (CVSFileNotFoundException e) { - // Done to allow non-managed resources to be used as arguments + // XXX Temporary fix to allow non-managed resources to be used as arguments resources[i] = localRoot.getFile(arguments[i]); } } @@ -484,7 +484,7 @@ public abstract class Command { } public void send(Session session) throws CVSException { if (option.length() != 0) super.send(session); - } + } } /** * Option subtype for local options that vary from command to command. @@ -516,13 +516,16 @@ public abstract class Command { */ public static LocalOption makeTagOption(CVSTag tag) { int type = tag.getType(); - if (type == CVSTag.BRANCH || type == CVSTag.VERSION || type == CVSTag.HEAD) { - return new LocalOption("-r", tag.getName()); - } else if (type == CVSTag.DATE) { - return new LocalOption("-D", tag.getName()); - } else { - // FIXME: can this ever happen??? throw an exception? - return null; + switch (type) { + case CVSTag.BRANCH: + case CVSTag.VERSION: + return new LocalOption("-r", tag.getName()); + case CVSTag.DATE: + return new LocalOption("-D", tag.getName()); + default: + // tag must not be HEAD + throw new IllegalArgumentException("Sticky tag not " + + "valid for trunk (HEAD)."); } } 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 48fb1b840..953c61ded 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 @@ -6,6 +6,7 @@ package org.eclipse.team.internal.ccvs.core.client; */ import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.team.ccvs.core.CVSTag; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption; import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; @@ -18,6 +19,20 @@ public class Update extends Command { public static final LocalOption IGNORE_LOCAL_CHANGES = new LocalOption("-C"); public static final LocalOption RETRIEVE_ABSENT_DIRECTORIES = new LocalOption("-d"); + /** + * Makes a -r or -D or -A option for a tag. + * Valid for: checkout export history rdiff update + */ + public static LocalOption makeTagOption(CVSTag tag) { + int type = tag.getType(); + switch (type) { + case CVSTag.HEAD: + return CLEAR_STICKY; + default: + return Command.makeTagOption(tag); + } + } + protected Update() { } protected String getCommandId() { return "update"; |