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$ |