KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > CVSMergeSyncInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core;
12
13 import org.eclipse.core.resources.IResource;
14 import org.eclipse.core.runtime.*;
15 import org.eclipse.team.core.TeamException;
16 import org.eclipse.team.core.subscribers.*;
17 import org.eclipse.team.core.synchronize.*;
18 import org.eclipse.team.core.variants.*;
19
20 public class CVSMergeSyncInfo extends CVSSyncInfo {
21
22     public CVSMergeSyncInfo(IResource local, IResourceVariant base, IResourceVariant remote, Subscriber subscriber) {
23         super(local, base, remote, subscriber);
24     }
25     
26     /* (non-Javadoc)
27      * @see org.eclipse.team.internal.ccvs.core.CVSSyncInfo#handleDeletionConflicts(int)
28      */

29     protected int handleDeletionConflicts(int kind) {
30         // (see bug 40053).
31
if(kind == (SyncInfo.CONFLICTING | SyncInfo.DELETION | SyncInfo.PSEUDO_CONFLICT)) {
32             return SyncInfo.IN_SYNC;
33         }
34         return kind;
35     }
36
37     protected int calculateKind() throws TeamException {
38         // Report merged resources as in-sync
39
if (((CVSMergeSubscriber)getSubscriber()).isMerged(getLocal())) {
40             return IN_SYNC;
41         }
42         
43         int kind = super.calculateKind();
44         
45         // Report outgoing resources as in-sync
46
if((kind & DIRECTION_MASK) == OUTGOING) {
47             return IN_SYNC;
48         }
49         
50         return kind;
51     }
52     
53     /* (non-Javadoc)
54      * @see org.eclipse.team.internal.ccvs.core.CVSSyncInfo#makeOutgoing(org.eclipse.core.runtime.IProgressMonitor)
55      */

56     public IStatus makeOutgoing(IProgressMonitor monitor) throws TeamException {
57         // Make the resource outgoing by marking it as merged with the subscriber
58
CVSMergeSubscriber subscriber = (CVSMergeSubscriber)getSubscriber();
59         subscriber.merged(new IResource[] {getLocal() });
60         return Status.OK_STATUS;
61     }
62 }
63
Popular Tags