1 11 package org.eclipse.team.internal.ccvs.ui.operations; 12 13 import java.util.Arrays ; 14 import java.util.HashSet ; 15 import java.util.Set ; 16 17 import org.eclipse.core.resources.IProject; 18 import org.eclipse.core.resources.IResource; 19 import org.eclipse.core.resources.mapping.ResourceMappingContext; 20 import org.eclipse.team.core.mapping.provider.SynchronizationScopeManager; 21 import org.eclipse.team.internal.ccvs.core.*; 22 import org.eclipse.ui.IWorkbenchPart; 23 24 28 public class OverrideAndUpdateOperation extends ReplaceOperation { 29 30 private IResource[] conflictingAdditions; 31 private final IProject project; 32 33 public OverrideAndUpdateOperation(IWorkbenchPart part, IProject project, IResource[] allResources, IResource[] conflictingAdditions, CVSTag tag, boolean recurse) { 34 super(part, allResources, tag, recurse); 35 this.project = project; 36 this.conflictingAdditions = conflictingAdditions; 37 } 38 39 42 protected ICVSResource[] getResourcesToUpdate(ICVSResource[] resources) throws CVSException { 43 Set update = new HashSet (); 45 ICVSResource[] conflicts = getCVSArguments(conflictingAdditions); 46 update.addAll(Arrays.asList(conflicts)); 47 update.addAll(Arrays.asList(super.getResourcesToUpdate(resources))); 48 return (ICVSResource[]) update.toArray(new ICVSResource[update.size()]); 49 } 50 51 54 protected ResourceMappingContext getResourceMappingContext() { 55 return new SingleProjectSubscriberContext(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), false, project); 56 } 57 58 protected SynchronizationScopeManager createScopeManager(boolean consultModels) { 59 return new SingleProjectScopeManager(getJobName(), getSelectedMappings(), getResourceMappingContext(), consultModels, project); 60 } 61 62 } 63 | Popular Tags |