KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > client > RDiff


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core.client;
12
13 import org.eclipse.team.internal.ccvs.core.CVSTag;
14
15 public class RDiff extends RemoteCommand {
16
17     /*** Local options: specific to rdiff ***/
18     public static final LocalOption SUMMARY = new LocalOption("-s", null); //$NON-NLS-1$
19

20     /* (non-Javadoc)
21      * @see org.eclipse.team.internal.ccvs.core.client.Request#getRequestId()
22      */

23     protected String JavaDoc getRequestId() {
24         return "rdiff"; //$NON-NLS-1$
25
}
26
27     /**
28      * Makes a -r or -D option for a tag.
29      * Valid for: checkout export history rdiff update
30      */

31     public static LocalOption makeTagOption(CVSTag tag) {
32         if (tag == null) tag = CVSTag.DEFAULT;
33         int type = tag.getType();
34         switch (type) {
35             case CVSTag.BRANCH:
36             case CVSTag.VERSION:
37             case CVSTag.HEAD:
38                 return new LocalOption("-r", tag.getName()); //$NON-NLS-1$
39
case CVSTag.DATE:
40                 return new LocalOption("-D", tag.getName()); //$NON-NLS-1$
41
default:
42                 // Unknow tag type!!!
43
throw new IllegalArgumentException JavaDoc();
44         }
45     }
46 }
47
Popular Tags