Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2009, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 10-15
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.team.internal.ui.synchronize.patch; |
11 |
package org.eclipse.team.internal.ui.synchronize.patch; |
12 |
|
12 |
|
|
|
13 |
import org.eclipse.compare.internal.core.patch.DiffProject; |
14 |
import org.eclipse.compare.internal.core.patch.FilePatch2; |
15 |
import org.eclipse.compare.internal.patch.Patcher; |
16 |
import org.eclipse.core.resources.*; |
13 |
import org.eclipse.core.runtime.CoreException; |
17 |
import org.eclipse.core.runtime.CoreException; |
14 |
import org.eclipse.core.runtime.IProgressMonitor; |
18 |
import org.eclipse.core.runtime.IProgressMonitor; |
15 |
import org.eclipse.team.core.diff.IDiff; |
19 |
import org.eclipse.team.core.diff.IDiff; |
Lines 35-54
class ApplyPatchSubscriberMergeContext extends SubscriberMergeContext {
Link Here
|
35 |
|
39 |
|
36 |
protected void makeInSync(IDiff diff, IProgressMonitor monitor) |
40 |
protected void makeInSync(IDiff diff, IProgressMonitor monitor) |
37 |
throws CoreException { |
41 |
throws CoreException { |
38 |
// TODO Auto-generated method stub |
42 |
IResource resource = getDiffTree().getResource(diff); |
39 |
System.out.println(">> [ignore] makeInSync: " + diff.toDiffString()); //$NON-NLS-1$ |
43 |
// IDiffElement element = PatchModelProvider.createModelObject(resource); |
|
|
44 |
Patcher patcher = ((ApplyPatchSubscriber)getSubscriber()).getPatcher(); |
45 |
FilePatch2[] diffs = patcher.getDiffs(); |
46 |
if (resource.getType() == IResource.FILE) { |
47 |
for (int i = 0; i < diffs.length; i++) { |
48 |
if (diffs[i] instanceof FilePatch2) { |
49 |
DiffProject diffProject = diffs[i].getProject(); |
50 |
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(diffProject.getName()); |
51 |
IFile file = project.getFile(diffs[i].getPath(patcher.isReversed())); |
52 |
if (file.equals(resource)) { |
53 |
patcher.setEnabled(diffs[i], false); |
54 |
System.out.println(">> ApplyPatchSubscriberMergeContext.makeInSync: disable " + diffs[i]); //$NON-NLS-1$ |
55 |
} |
56 |
} |
57 |
} |
58 |
} |
40 |
} |
59 |
} |
41 |
|
60 |
|
42 |
public void markAsMerged(IDiff node, boolean inSyncHint, |
61 |
public void markAsMerged(IDiff node, boolean inSyncHint, |
43 |
IProgressMonitor monitor) throws CoreException { |
62 |
IProgressMonitor monitor) throws CoreException { |
44 |
// TODO Auto-generated method stub |
63 |
// TODO Auto-generated method stub |
45 |
System.out |
64 |
System.out |
46 |
.println(">> [ignore] markAsMerged: " + node.toDiffString() + ", inSyncHint " + inSyncHint); //$NON-NLS-1$ //$NON-NLS-2$ |
65 |
.println(">> [ignore] ApplyPatchSubscriberMergeContext.markAsMerged: " + node.toDiffString() + ", inSyncHint " + inSyncHint); //$NON-NLS-1$ //$NON-NLS-2$ |
47 |
} |
66 |
} |
48 |
|
67 |
|
49 |
public void reject(IDiff diff, IProgressMonitor monitor) |
68 |
public void reject(IDiff diff, IProgressMonitor monitor) |
50 |
throws CoreException { |
69 |
throws CoreException { |
51 |
// TODO Auto-generated method stub |
70 |
// TODO Auto-generated method stub |
52 |
System.out.println(">> [ignore] reject: " + diff.toDiffString()); //$NON-NLS-1$ |
71 |
System.out.println(">> [ignore] ApplyPatchSubscriberMergeContext.reject: " + diff.toDiffString()); //$NON-NLS-1$ |
53 |
} |
72 |
} |
54 |
} |
73 |
} |