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 75545 Details for
Bug 84866
[Change Sets] compare with branch or version: wrong commit sets displayed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Initial patch
patch84866.txt (text/plain), 4.95 KB, created by
Michael Valenta
on 2007-08-07 11:20:18 EDT
(
hide
)
Description:
Initial patch
Filename:
MIME Type:
Creator:
Michael Valenta
Created:
2007-08-07 11:20:18 EDT
Size:
4.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java,v >retrieving revision 1.8 >diff -u -r1.8 CheckedInChangeSetCollector.java >--- src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java 22 Apr 2006 02:23:53 -0000 1.8 >+++ src/org/eclipse/team/internal/ccvs/ui/mappings/CheckedInChangeSetCollector.java 7 Aug 2007 15:18:14 -0000 >@@ -10,13 +10,9 @@ > *******************************************************************************/ > package org.eclipse.team.internal.ccvs.ui.mappings; > >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.HashSet; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Set; >+import java.util.*; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.*; > import org.eclipse.core.runtime.jobs.Job; >@@ -29,9 +25,10 @@ > import org.eclipse.team.core.variants.IResourceVariant; > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.mapping.CVSCheckedInChangeSet; >+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; > import org.eclipse.team.internal.ccvs.core.resources.RemoteResource; > import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; >-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; >+import org.eclipse.team.internal.ccvs.ui.*; > import org.eclipse.team.internal.ccvs.ui.Policy; > import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation.LogEntryCache; > import org.eclipse.team.internal.ccvs.ui.subscriber.CVSChangeSetCollector; >@@ -110,7 +107,8 @@ > private final Subscriber subscriber; > > private HashSet updatedSets; >- >+ private VersionCollator versionCollator = new VersionCollator(); >+ > public CheckedInChangeSetCollector(ISynchronizePageConfiguration configuration, Subscriber subscriber) { > this.configuration = configuration; > this.subscriber = subscriber; >@@ -354,13 +352,71 @@ > // remote. > addRemoteChange(info, null, null); > } else { >- for (int i = 0; i < logEntries.length; i++) { >+ // Sort the log entries by revision so we can determine which to prune, if any >+ Arrays.sort(logEntries, new Comparator() { >+ public int compare(Object o1, Object o2) { >+ return versionCollator.compare(((ILogEntry)o1).getRevision(),((ILogEntry)o2).getRevision()); >+ } >+ }); >+ int i = 0; >+ if (shouldPruneFirst(info, logEntries)) { >+ i = 1; >+ } >+ for (; i < logEntries.length; i++) { > ILogEntry entry = logEntries[i]; > addRemoteChange(info, remoteResource, entry); > } > } > } > >+ private boolean shouldPruneFirst(SyncInfo info, ILogEntry[] logEntries) { >+ // We only prune when comparing >+ if (subscriber instanceof CVSCompareSubscriber) { >+ // If there is only, then show it >+ if (logEntries.length == 1) >+ return false; >+ // Prune the first if the revisions are in sequence and the first is the local revision or has the tag >+ if (ResourceSyncInfo.isLaterRevision(logEntries[1].getRevision(), logEntries[0].getRevision()) >+ && (isLocalRevision(info.getLocal(), logEntries[0].getRevision())) >+ || (hasQueryTag(logEntries[0]))) >+ return true; >+ } >+ return false; >+ } >+ >+ private boolean hasQueryTag(ILogEntry logEntry) { >+ if (subscriber instanceof CVSCompareSubscriber) { >+ CVSCompareSubscriber ccs = (CVSCompareSubscriber) subscriber; >+ CVSTag tag = ccs.getTag(); >+ if (tag.getType() == CVSTag.VERSION) { >+ CVSTag[] tags = logEntry.getTags(); >+ // TODO: Tags are not fetched!! so just prune it >+ if (tags.length == 0) >+ return true; >+ for (int i = 0; i < tags.length; i++) { >+ CVSTag entryTag = tags[i]; >+ if (entryTag.equals(tag)) { >+ return true; >+ } >+ } >+ } >+ } >+ return false; >+ } >+ >+ private boolean isLocalRevision(IResource local, String revision) { >+ ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)local); >+ try { >+ byte[] bytes = file.getSyncBytes(); >+ if (bytes == null) >+ return false; >+ return ResourceSyncInfo.getRevision(bytes).equals(revision); >+ } catch (CVSException e) { >+ CVSUIPlugin.log(e); >+ } >+ return false; >+ } >+ > private boolean isDeletedRemotely(SyncInfo info) { > int kind = info.getKind(); > if(kind == (SyncInfo.INCOMING | SyncInfo.DELETION)) return true; >@@ -404,7 +460,7 @@ > } > } > >- private SyncInfoToDiffConverter getConverter() { >+ private SyncInfoToDiffConverter getConverter() { > SyncInfoToDiffConverter converter = (SyncInfoToDiffConverter)Utils.getAdapter(subscriber, SyncInfoToDiffConverter.class); > if (converter == null) > converter = SyncInfoToDiffConverter.getDefault();
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 84866
: 75545