Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 36436 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/core/client/Command.java (+8 lines)
Lines 19-24 Link Here
19
import org.eclipse.osgi.util.NLS;
19
import org.eclipse.osgi.util.NLS;
20
import org.eclipse.team.internal.ccvs.core.*;
20
import org.eclipse.team.internal.ccvs.core.*;
21
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
21
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
22
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
22
23
23
/**
24
/**
24
 * Abstract base class for command requests.
25
 * Abstract base class for command requests.
Lines 92-97 Link Here
92
	public static final KSubstOption KSUBST_TEXT_EXPAND_LOCKER = new KSubstOption("-kkvl"); //$NON-NLS-1$
93
	public static final KSubstOption KSUBST_TEXT_EXPAND_LOCKER = new KSubstOption("-kkvl"); //$NON-NLS-1$
93
	public static final KSubstOption KSUBST_TEXT_VALUES_ONLY = new KSubstOption("-kv"); //$NON-NLS-1$
94
	public static final KSubstOption KSUBST_TEXT_VALUES_ONLY = new KSubstOption("-kv"); //$NON-NLS-1$
94
	public static final KSubstOption KSUBST_TEXT_KEYWORDS_ONLY = new KSubstOption("-kk"); //$NON-NLS-1$
95
	public static final KSubstOption KSUBST_TEXT_KEYWORDS_ONLY = new KSubstOption("-kk"); //$NON-NLS-1$
96
	public static KSubstOption KSUBST_TEXT_KEYWORDS_ONLY_MERGE = null;
95
97
96
	/*** Default command output listener ***/
98
	/*** Default command output listener ***/
97
	protected static final ICommandOutputListener DEFAULT_OUTPUT_LISTENER = new CommandOutputListener();
99
	protected static final ICommandOutputListener DEFAULT_OUTPUT_LISTENER = new CommandOutputListener();
Lines 324-329 Link Here
324
				try {
326
				try {
325
				    session.setCurrentCommand(Command.this);
327
				    session.setCurrentCommand(Command.this);
326
					status[0] = doExecute(session, gOptions, lOptions, arguments, listener, monitor);
328
					status[0] = doExecute(session, gOptions, lOptions, arguments, listener, monitor);
329
					if ( ((CVSRepositoryLocation)session.getCVSRepositoryLocation()).CanMergeWithKeywords() ) {
330
						KSUBST_TEXT_KEYWORDS_ONLY_MERGE = new KSubstOption("-kk"); //$NON-NLS-1$
331
					}
332
			        else {
333
			        	KSUBST_TEXT_KEYWORDS_ONLY_MERGE = null;
334
			        }
327
					notifyConsoleOnCompletion(session, status[0], null);
335
					notifyConsoleOnCompletion(session, status[0], null);
328
				} catch (CVSException e) {
336
				} catch (CVSException e) {
329
					notifyConsoleOnCompletion(session, null, e);
337
					notifyConsoleOnCompletion(session, null, e);
(-)src/org/eclipse/team/internal/ccvs/core/client/Version.java (-1 / +14 lines)
Lines 54-59 Link Here
54
		ICommandOutputListener listener = new ICommandOutputListener() {
54
		ICommandOutputListener listener = new ICommandOutputListener() {
55
			public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
55
			public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
56
				String knownPrefix = null;
56
				String knownPrefix = null;
57
				String versionNumber = null;
57
				boolean isCVSNT = false;
58
				boolean isCVSNT = false;
58
				if (line.startsWith(CVS_NT_PREFIX_1)) {
59
				if (line.startsWith(CVS_NT_PREFIX_1)) {
59
					isCVSNT = true;
60
					isCVSNT = true;
Lines 67-73 Link Here
67
				IStatus status = OK;
68
				IStatus status = OK;
68
				int serverType = CVSRepositoryLocation.CVS_SERVER;
69
				int serverType = CVSRepositoryLocation.CVS_SERVER;
69
				if (knownPrefix != null) {
70
				if (knownPrefix != null) {
70
					String versionNumber = line.substring(knownPrefix.length(), line.indexOf(' ', knownPrefix.length() + 1));
71
					versionNumber = line.substring(knownPrefix.length(), line.indexOf(' ', knownPrefix.length() + 1));
71
					if (versionNumber.startsWith("1.10") || versionNumber.equals("1.11") || versionNumber.equals("1.11.1")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
72
					if (versionNumber.startsWith("1.10") || versionNumber.equals("1.11") || versionNumber.equals("1.11.1")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
72
					    serverType = CVSRepositoryLocation.UNSUPPORTED_SERVER;
73
					    serverType = CVSRepositoryLocation.UNSUPPORTED_SERVER;
73
						status = new CVSStatus(IStatus.WARNING, CVSStatus.UNSUPPORTED_SERVER_VERSION, NLS.bind(CVSMessages.Version_unsupportedVersion, new String[] { location.getHost(), versionNumber }),location);
74
						status = new CVSStatus(IStatus.WARNING, CVSStatus.UNSUPPORTED_SERVER_VERSION, NLS.bind(CVSMessages.Version_unsupportedVersion, new String[] { location.getHost(), versionNumber }),location);
Lines 79-84 Link Here
79
					status = new CVSStatus(IStatus.INFO, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_unknownVersionFormat, new String[] { location.getHost(), line }), location);
80
					status = new CVSStatus(IStatus.INFO, CVSStatus.SERVER_IS_UNKNOWN, NLS.bind(CVSMessages.Version_unknownVersionFormat, new String[] { location.getHost(), line }), location);
80
				}
81
				}
81
				((CVSRepositoryLocation)location).setServerPlaform(serverType);
82
				((CVSRepositoryLocation)location).setServerPlaform(serverType);
83
				/*
84
				 * CVS prior to 1.12.2, there was a major problem with using
85
				 * `-kk' on merges. Namely, `-kk' overrode any default keyword
86
				 * expansion mode set in the archive file in the repository.
87
				 * This could, unfortunately for some users, cause data
88
				 * corruption in binary files. CVSNT has the same problem.
89
				 */
90
				if (serverType == CVSRepositoryLocation.CVS_SERVER
91
						&& !versionNumber.startsWith("1.11") && !versionNumber.equals("1.12.1")) //$NON-NLS-1$ //$NON-NLS-2$
92
					((CVSRepositoryLocation)location).setMergeWithKeywords(true);
93
				else
94
					((CVSRepositoryLocation)location).setMergeWithKeywords(false);
82
				return status;
95
				return status;
83
			}
96
			}
84
			public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
97
			public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor) {
(-)src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java (-1 / +23 lines)
Lines 139-144 Link Here
139
	 * When this is set, subsequent attempts should prompt before attempting to connect
139
	 * When this is set, subsequent attempts should prompt before attempting to connect
140
	 */
140
	 */
141
	private boolean previousAuthenticationFailed = false;
141
	private boolean previousAuthenticationFailed = false;
142
143
	/*
144
	 * Field that indicates if CVS server properly supports turn off of keyword expansion
145
	 * (option -kk) when merging.
146
	 */
147
	private boolean MergeWithKeywords = false;
142
	
148
	
143
	/**
149
	/**
144
	 * Return the preferences node whose child nodes are the know repositories
150
	 * Return the preferences node whose child nodes are the know repositories
Lines 1090-1096 Link Here
1090
				serverPlatform = UNDETERMINED_PLATFORM;
1096
				serverPlatform = UNDETERMINED_PLATFORM;
1091
		}
1097
		}
1092
	}
1098
	}
1093
	
1099
1100
	/**
1101
	 * check keyword expansion mode for merging
1102
	 * @return true: it is safe to turn off of keyword expansion (use option -kk) when merging
1103
	 */
1104
	public boolean CanMergeWithKeywords() {
1105
		return MergeWithKeywords;
1106
	}
1107
1108
	/**
1109
	 * set keyword expansion mode for merging
1110
	 * true: it is safe to turn off of keyword expansion (option -kk) when merging
1111
	 * false: using option -kk is not supported or might corrupt binary files
1112
	 */
1113
	public void setMergeWithKeywords(boolean MergeWithKeywords) {
1114
		this.MergeWithKeywords = MergeWithKeywords;
1115
	}
1094
	/**
1116
	/**
1095
	 * @see ICVSRepositoryLocation#flushUserInfo()
1117
	 * @see ICVSRepositoryLocation#flushUserInfo()
1096
	 */
1118
	 */
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizard.java (+3 lines)
Lines 133-138 Link Here
133
133
134
    private Command.LocalOption[] getLocalOptions(CVSTag startTag, CVSTag endTag) {
134
    private Command.LocalOption[] getLocalOptions(CVSTag startTag, CVSTag endTag) {
135
        List options = new ArrayList();
135
        List options = new ArrayList();
136
        if (Command.KSUBST_TEXT_KEYWORDS_ONLY_MERGE != null){ 
137
        	options.add(Command.KSUBST_TEXT_KEYWORDS_ONLY_MERGE);
138
        }
136
        if (startTag != null) {
139
        if (startTag != null) {
137
            options.add(Command.makeArgumentOption(Update.JOIN, startTag.getName()));
140
            options.add(Command.makeArgumentOption(Update.JOIN, startTag.getName()));
138
        }
141
        }

Return to bug 36436