View | Details | Raw Unified | Return to bug 210627 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java (-2 / +31 lines)
Lines 170-182 Link Here
170
	 * @return a stream for the diff output
170
	 * @return a stream for the diff output
171
	 */
171
	 */
172
	protected abstract PrintStream openStream() throws CVSException;
172
	protected abstract PrintStream openStream() throws CVSException;
173
	
174
	private static Comparator RESOURCE_COMPARATOR = new Comparator() {
175
		public int compare(Object o1, Object o2) {
176
			IResource r1 = (IResource) o1;
177
			IResource r2 = (IResource) o2;
178
			return r1.getFullPath().toString().compareTo(r2.getFullPath().toString());
179
		}};
173
180
174
	protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
181
	protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
175
		
182
		
176
		//add this project to the total projects encountered
183
		//add this project to the total projects encountered
177
		final HashSet newFiles = new HashSet(); //array of ICVSResource - need HashSet to guard for duplicate entries
178
		final HashSet existingFiles = new HashSet(); //array of IResource - need HashSet to guard for duplicate entries
179
		
184
		
185
		//array of ICVSResource - need Set to guard for duplicate entries
186
		final SortedSet newFiles = new TreeSet(new Comparator() {
187
			public int compare(Object o1, Object o2) {
188
				ICVSResource r1 = (ICVSResource) o1;
189
				ICVSResource r2 = (ICVSResource) o2;
190
				return RESOURCE_COMPARATOR.compare(r1.getIResource(), r2.getIResource());
191
			}
192
		});
193
		//array of IResource - need Set to guard for duplicate entries
194
		final SortedSet existingFiles = new TreeSet(RESOURCE_COMPARATOR); 
195
180
		monitor.beginTask(null,100);
196
		monitor.beginTask(null,100);
181
		final IProgressMonitor subMonitor = Policy.subMonitorFor(monitor,10);
197
		final IProgressMonitor subMonitor = Policy.subMonitorFor(monitor,10);
182
		for (int i = 0; i < resources.length; i++) {
198
		for (int i = 0; i < resources.length; i++) {
Lines 321-326 Link Here
321
		return CVSUIMessages.DiffOperation_1;
337
		return CVSUIMessages.DiffOperation_1;
322
	}
338
	}
323
	
339
	
340
	Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException {
341
		Map providerTraversal = super.getProviderTraversalMapping(monitor);
342
		SortedMap result = new TreeMap(new Comparator() {
343
			public int compare(Object o1, Object o2) {
344
				CVSTeamProvider p1 = (CVSTeamProvider) o1;
345
				CVSTeamProvider p2 = (CVSTeamProvider) o2;
346
				return RESOURCE_COMPARATOR.compare(p1.getProject(), p2.getProject());
347
			}
348
		});
349
		result.putAll(providerTraversal);
350
		return result;
351
	}
352
324
	private void addFileToDiff(ICVSFolder patchRoot, ICVSFile file, PrintStream printStream, int format) throws CVSException {
353
	private void addFileToDiff(ICVSFolder patchRoot, ICVSFile file, PrintStream printStream, int format) throws CVSException {
325
		
354
		
326
		String nullFilePrefix = ""; //$NON-NLS-1$
355
		String nullFilePrefix = ""; //$NON-NLS-1$
(-)src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java (-9 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-23 Link Here
11
package org.eclipse.team.internal.ccvs.ui.operations;
11
package org.eclipse.team.internal.ccvs.ui.operations;
12
12
13
import java.lang.reflect.InvocationTargetException;
13
import java.lang.reflect.InvocationTargetException;
14
import java.util.ArrayList;
14
import java.util.*;
15
import java.util.Arrays;
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.Map;
20
import java.util.Set;
21
15
22
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IResource;
17
import org.eclipse.core.resources.IResource;
Lines 325-331 Link Here
325
	 * Helper method. Return a Map mapping provider to a list of resources
319
	 * Helper method. Return a Map mapping provider to a list of resources
326
	 * shared with that provider.
320
	 * shared with that provider.
327
	 */
321
	 */
328
	private Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException {
322
	Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException {
329
		Map result = new HashMap();
323
		Map result = new HashMap();
330
		ResourceMapping[] mappings = getScope().getMappings();
324
		ResourceMapping[] mappings = getScope().getMappings();
331
        for (int j = 0; j < mappings.length; j++) {
325
        for (int j = 0; j < mappings.length; j++) {

Return to bug 210627