diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RDiff.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RDiff.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RDiff.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RDiff.java new file mode 100644 index 000000000..de27da825 --- /dev/null +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RDiff.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.team.internal.ccvs.core.client; + +import org.eclipse.team.internal.ccvs.core.CVSTag; + +public class RDiff extends RemoteCommand { + + /*** Local options: specific to rdiff ***/ + public static final LocalOption SUMMARY = new LocalOption("-s", null); //$NON-NLS-1$ + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ccvs.core.client.Request#getRequestId() + */ + protected String getRequestId() { + return "rdiff"; //$NON-NLS-1$ + } + + /** + * Makes a -r or -D option for a tag. + * Valid for: checkout export history rdiff update + */ + public static LocalOption makeTagOption(CVSTag tag) { + if (tag == null) tag = CVSTag.DEFAULT; + int type = tag.getType(); + switch (type) { + case CVSTag.BRANCH: + case CVSTag.VERSION: + case CVSTag.HEAD: + return new LocalOption("-r", tag.getName()); //$NON-NLS-1$ + case CVSTag.DATE: + return new LocalOption("-D", tag.getName()); //$NON-NLS-1$ + default: + // Unknow tag type!!! + throw new IllegalArgumentException(); + } + } +} |