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 163295 Details for
Bug 306508
[Backport] [Sync View] Error message during update operation after synchronization
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]
Fix v01
306508_20100329.txt (text/plain), 5.85 KB, created by
Szymon Brandys
on 2010-03-29 11:57:35 EDT
(
hide
)
Description:
Fix v01
Filename:
MIME Type:
Creator:
Szymon Brandys
Created:
2010-03-29 11:57:35 EDT
Size:
5.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java,v >retrieving revision 1.14 >diff -u -r1.14 SafeUpdateOperation.java >--- src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java 29 Mar 2006 17:13:53 -0000 1.14 >+++ src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java 29 Mar 2010 15:57:11 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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,33 +11,33 @@ > package org.eclipse.team.internal.ccvs.ui.subscriber; > > import java.lang.reflect.InvocationTargetException; >-import java.util.ArrayList; >-import java.util.HashSet; >-import java.util.List; >-import java.util.Set; >+import java.util.*; > > import org.eclipse.compare.structuremergeviewer.IDiffElement; > import org.eclipse.core.resources.*; >+import org.eclipse.core.resources.mapping.ResourceMapping; >+import org.eclipse.core.resources.mapping.ResourceMappingContext; >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.jobs.ISchedulingRule; >+import org.eclipse.core.runtime.jobs.MultiRule; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.core.TeamException; >-import org.eclipse.team.core.synchronize.FastSyncInfoFilter; >-import org.eclipse.team.core.synchronize.SyncInfo; >-import org.eclipse.team.core.synchronize.SyncInfoSet; >-import org.eclipse.team.core.synchronize.FastSyncInfoFilter.AndSyncInfoFilter; >-import org.eclipse.team.core.synchronize.FastSyncInfoFilter.OrSyncInfoFilter; >-import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter; >+import org.eclipse.team.core.mapping.provider.SynchronizationScopeManager; >+import org.eclipse.team.core.synchronize.*; >+import org.eclipse.team.core.synchronize.FastSyncInfoFilter.*; > import org.eclipse.team.core.variants.IResourceVariant; >-import org.eclipse.team.internal.ccvs.core.CVSException; >-import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; >-import org.eclipse.team.internal.ccvs.core.ICVSFile; >+import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption; > import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; >+import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer; > import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; > import org.eclipse.team.internal.ccvs.ui.*; >-import org.eclipse.team.internal.ccvs.ui.operations.UpdateOnlyMergableOperation; >+import org.eclipse.team.internal.ccvs.ui.Policy; >+import org.eclipse.team.internal.ccvs.ui.operations.*; > import org.eclipse.team.internal.ui.TeamUIPlugin; >+import org.eclipse.team.internal.ui.Utils; > import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; > > /** >@@ -64,6 +64,67 @@ > public boolean shouldRun() { > return promptIfNeeded(); > } >+ >+ /** >+ * Run the operation for the sync infos from the given project. >+ * >+ * @param projectSyncInfos the project syncInfos >+ * @param project the project >+ * @param monitor a progress monitor >+ * @throws InvocationTargetException >+ */ >+ protected void run(final Map projectSyncInfos, final IProject project, >+ IProgressMonitor monitor) throws InvocationTargetException { >+ try { >+ IResource[] resources = getIResourcesFrom(((SyncInfoSet) projectSyncInfos >+ .get(project)).getSyncInfos()); >+ ResourceMapping[] selectedMappings = Utils >+ .getResourceMappings(resources); >+ ResourceMappingContext context = new SingleProjectSubscriberContext( >+ CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), >+ false, project); >+ SynchronizationScopeManager manager = new SingleProjectScopeManager( >+ getJobName(), selectedMappings, context, true, project); >+ manager.initialize(null); >+ >+ // Pass the scheduling rule to the synchronizer so that sync change >+ // events and cache commits to disk are batched >+ EclipseSynchronizer.getInstance().run(getUpdateRule(manager), >+ new ICVSRunnable() { >+ public void run(IProgressMonitor monitor) >+ throws CVSException { >+ try { >+ runWithProjectRule(project, >+ (SyncInfoSet) projectSyncInfos >+ .get(project), monitor); >+ } catch (TeamException e) { >+ throw CVSException.wrapException(e); >+ } >+ } >+ }, Policy.subMonitorFor(monitor, 100)); >+ } catch (TeamException e) { >+ throw new InvocationTargetException(e); >+ } catch (CoreException e) { >+ throw new InvocationTargetException(e); >+ } >+ } >+ >+ private ISchedulingRule getUpdateRule(SynchronizationScopeManager manager) { >+ ISchedulingRule rule = null; >+ ResourceMapping[] mappings = manager.getScope().getMappings(); >+ for (int i = 0; i < mappings.length; i++) { >+ ResourceMapping mapping = mappings[i]; >+ IProject[] mappingProjects = mapping.getProjects(); >+ for (int j = 0; j < mappingProjects.length; j++) { >+ if (rule == null) { >+ rule = mappingProjects[j]; >+ } else { >+ rule = MultiRule.combine(rule, mappingProjects[j]); >+ } >+ } >+ } >+ return rule; >+ } > > /* (non-Javadoc) > * @see org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberOperation#run(org.eclipse.core.runtime.IProgressMonitor)
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 306508
:
163295
|
163389