Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 147679 Details for
Bug 210627
Create Patch should sort diffs by file path
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix v02
clipboard.txt (text/plain), 6.76 KB, created by
Tomasz Zarna
on 2009-09-21 06:34:37 EDT
(
hide
)
Description:
Fix v02
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2009-09-21 06:34:37 EDT
Size:
6.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java,v >retrieving revision 1.18 >diff -u -r1.18 DiffOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java 24 Apr 2009 09:33:19 -0000 1.18 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/DiffOperation.java 21 Sep 2009 10:35:27 -0000 >@@ -170,7 +170,27 @@ > * @return a stream for the diff output > */ > protected abstract PrintStream openStream() throws CVSException; >- >+ >+ private static Comparator COMPARATOR = new Comparator() { >+ private int compare(IResource r1, IResource r2) { >+ return r1.getFullPath().toString().compareTo(r2.getFullPath().toString()); >+ } >+ public int compare(Object o1, Object o2) { >+ IResource r1 = null; >+ IResource r2 = null; >+ if (o1 instanceof ICVSResource) { >+ r1 = ((ICVSResource)o1).getIResource(); >+ } else { >+ r1 = (IResource)o1; >+ } >+ if (o2 instanceof ICVSResource) { >+ r2 = ((ICVSResource)o2).getIResource(); >+ } else { >+ r2 = (IResource)o2; >+ } >+ return compare(r1, r2); >+ } >+ }; > protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException { > > //add this project to the total projects encountered >@@ -207,6 +227,11 @@ > } > }, recurse); > } >+ >+ final SortedSet allFiles = new TreeSet(COMPARATOR); >+ allFiles.addAll(existingFiles); >+ allFiles.addAll(newFiles); >+ > subMonitor.done(); > > //Check options >@@ -233,13 +258,6 @@ > IProject project=resources[0].getProject(); > stream.println(WorkspacePatcherUI.getWorkspacePatchProjectHeader(project)); > } >- try{ >- super.execute(provider, (IResource[]) existingFiles.toArray(new IResource[existingFiles.size()]), recurse, Policy.subMonitorFor(monitor, 90)); >- } catch(CVSCommunicationException ex){ // see bug 123430 >- CVSUIPlugin.openError(getShell(), null, null, ex, CVSUIPlugin.PERFORM_SYNC_EXEC | CVSUIPlugin.LOG_OTHER_EXCEPTIONS); >- } catch (CVSException ex) { >- handleCVSException(ex); >- } > } > > if (!newFiles.isEmpty() && Diff.INCLUDE_NEWFILES.isElementOf(localoptions)){ >@@ -251,16 +269,38 @@ > IProject project=resources[0].getProject(); > stream.println(WorkspacePatcherUI.getWorkspacePatchProjectHeader(project)); > } >- >- for (Iterator iter = newFiles.iterator(); iter.hasNext();) { >- ICVSFile cvsFile = (ICVSFile) iter.next(); >+ } >+ >+ List existingFilesSubList = new ArrayList(); >+ for (Iterator iter = allFiles.iterator(); iter.hasNext();) { >+ Object file = iter.next(); >+ if (existingFiles.contains(file)) { >+ existingFilesSubList.add(file); >+ } else if (newFiles.contains(file)){ >+ addExistingFilesSubListToDiff(provider, existingFilesSubList, recurse, monitor, existingFiles.size()); >+ ICVSFile cvsFile = (ICVSFile) file; > addFileToDiff(getNewFileRoot(cvsFile), cvsFile,stream,format); > } > } >- >+ addExistingFilesSubListToDiff(provider, existingFilesSubList, recurse, monitor, existingFiles.size()); >+ > monitor.done(); > } > >+ private void addExistingFilesSubListToDiff(CVSTeamProvider provider, Collection subList, boolean recurse, IProgressMonitor monitor, int existingFilesTotal) throws InterruptedException { >+ if (!subList.isEmpty()) { >+ int ticks = 90 * subList.size() / existingFilesTotal; >+ try{ >+ super.execute(provider, (IResource[]) subList.toArray(new IResource[subList.size()]), recurse, Policy.subMonitorFor(monitor, ticks)); >+ } catch(CVSCommunicationException ex){ // see bug 123430 >+ CVSUIPlugin.openError(getShell(), null, null, ex, CVSUIPlugin.PERFORM_SYNC_EXEC | CVSUIPlugin.LOG_OTHER_EXCEPTIONS); >+ } catch (CVSException ex) { >+ handleCVSException(ex); >+ } >+ subList.clear(); >+ } >+ } >+ > /** > * Checks if the exception contain a status that has to be shown to the > * user. If yes, the method shows the dialog. >@@ -321,6 +361,19 @@ > return CVSUIMessages.DiffOperation_1; > } > >+ Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException { >+ Map providerTraversal = super.getProviderTraversalMapping(monitor); >+ SortedMap result = new TreeMap(new Comparator() { >+ public int compare(Object o1, Object o2) { >+ CVSTeamProvider p1 = (CVSTeamProvider) o1; >+ CVSTeamProvider p2 = (CVSTeamProvider) o2; >+ return COMPARATOR.compare(p1.getProject(), p2.getProject()); >+ } >+ }); >+ result.putAll(providerTraversal); >+ return result; >+ } >+ > private void addFileToDiff(ICVSFolder patchRoot, ICVSFile file, PrintStream printStream, int format) throws CVSException { > > String nullFilePrefix = ""; //$NON-NLS-1$ >Index: src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java,v >retrieving revision 1.36 >diff -u -r1.36 RepositoryProviderOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java 3 Oct 2008 11:26:05 -0000 1.36 >+++ src/org/eclipse/team/internal/ccvs/ui/operations/RepositoryProviderOperation.java 21 Sep 2009 10:35:27 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,13 +11,7 @@ > package org.eclipse.team.internal.ccvs.ui.operations; > > import java.lang.reflect.InvocationTargetException; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.HashMap; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >-import java.util.Set; >+import java.util.*; > > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -325,7 +319,7 @@ > * Helper method. Return a Map mapping provider to a list of resources > * shared with that provider. > */ >- private Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException { >+ Map getProviderTraversalMapping(IProgressMonitor monitor) throws CoreException { > Map result = new HashMap(); > ResourceMapping[] mappings = getScope().getMappings(); > for (int j = 0; j < mappings.length; j++) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 210627
:
147425
| 147679 |
147680