diff options
author | Michael Valenta | 2003-10-02 13:28:17 +0000 |
---|---|---|
committer | Michael Valenta | 2003-10-02 13:28:17 +0000 |
commit | 5461895ae78a42945a24203caf03624bd4683b0b (patch) | |
tree | 68041d9f707a1f2ef2a9a0050a5bcbd0472c07b2 | |
parent | 4655a01120705d2cb7c80f5421296e2ba605df17 (diff) | |
download | eclipse.platform.team-5461895ae78a42945a24203caf03624bd4683b0b.tar.gz eclipse.platform.team-5461895ae78a42945a24203caf03624bd4683b0b.tar.xz eclipse.platform.team-5461895ae78a42945a24203caf03624bd4683b0b.zip |
43938: bin not ignored when in .cvsignore
5 files changed, 49 insertions, 15 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java index 4abc9c0cf..892f01906 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java @@ -137,7 +137,9 @@ public interface ICVSFile extends ICVSResource { Date getTimeStamp(); /** - * If the date is <code>null</code> then the current time is used. + * If the date is <code>null</code> then the current time is used. After setTimeStamp is + * invoked, it is assumed that the file is CLEAN. If this is not the case, it is the clients + * responsibility to invoke setSyncBytes() with the appropriate modification state. * * This method is used by the command framework and should not be used by other clients. */ diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java index 1d42ac5c3..9fb627e63 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java @@ -104,7 +104,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile { try { EclipseSynchronizer.getInstance().setTimeStamp(getIFile(), time); } finally { - handleModification(false /* not an addition */); + setModified(false); } } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java index 486fd295a..b47b0afd3 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java @@ -31,6 +31,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; @@ -45,7 +46,6 @@ import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; import org.eclipse.team.internal.ccvs.core.ICVSFile; import org.eclipse.team.internal.ccvs.core.ICVSFolder; import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; -import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource; import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.ICVSResource; @@ -63,9 +63,11 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; import org.eclipse.team.internal.ccvs.core.util.SyncFileChangeListener; import org.eclipse.team.internal.ccvs.ui.operations.CVSOperation; +import org.eclipse.team.internal.ccvs.ui.operations.CheckoutSingleProjectOperation; import org.eclipse.team.internal.ccvs.ui.operations.ITagOperation; import org.eclipse.team.internal.ccvs.ui.operations.TagInRepositoryOperation; import org.eclipse.team.internal.ccvs.ui.operations.TagOperation; +import org.eclipse.team.tests.ccvs.ui.unit.HeadlessCVSRunnableContext; public class EclipseTest extends EclipseWorkspaceTest { @@ -311,20 +313,23 @@ public class EclipseTest extends EclipseWorkspaceTest { } public static void checkout( - ICVSRepositoryLocation repository, - IProject project, - String sourceModule, - CVSTag tag, + final ICVSRepositoryLocation repository, + final IProject project, + final String sourceModule, + final CVSTag tag, IProgressMonitor monitor) throws TeamException { - if (sourceModule == null) - sourceModule = project.getName(); - CVSWorkspaceRoot.checkout(new ICVSRemoteFolder[] { new RemoteFolder(null, repository, sourceModule, tag)}, - new IProject[] { project }, monitor); + RemoteFolder remote = new RemoteFolder(null, repository, sourceModule == null ? project.getName() : sourceModule, tag); + executeHeadless(new CheckoutSingleProjectOperation(null, remote, project, null, false /* the project is not preconfigured */) { + public boolean promptToOverwrite(String title, String msg) { + return true; + } + }); + } - - protected IProject checkoutProject(IProject project, String moduleName, CVSTag tag) throws TeamException { + + protected IProject checkoutProject(IProject project, String moduleName, CVSTag tag) throws TeamException { if (project == null) project = getWorkspace().getRoot().getProject(new Path(moduleName).lastSegment()); checkout(getRepository(), project, moduleName, tag, DEFAULT_MONITOR); @@ -729,5 +734,14 @@ public class EclipseTest extends EclipseWorkspaceTest { } } } + + protected static void executeHeadless(CVSOperation op) throws CVSException { + try { + op.setCVSRunnableContext(new HeadlessCVSRunnableContext()); + op.run(); + } catch (InterruptedException e) { + throw new OperationCanceledException(); + } + } } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/IsModifiedTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/IsModifiedTests.java index 1d9a0714c..f5c70779c 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/IsModifiedTests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/IsModifiedTests.java @@ -541,6 +541,25 @@ public class IsModifiedTests extends EclipseTest { assertTrue(!file.exists()); assertModificationState(project, null, true); } + + public void testIgnoredAfterCheckout() throws TeamException, CoreException { + // Bug 43938 + // Create a project and add a .cvsignore to it + IProject project = createProject("testIgnoredAfterCheckout", new String[] { ".changed.txt", "deleted.txt", "folder1/", "folder1/a.txt", "folder1/folder2/b.txt"}); + project.getFile(".cvsignore").create(new ByteArrayInputStream("ignored".getBytes()), false, DEFAULT_MONITOR); + getProvider(project).add(new IResource[] {project.getFile(".cvsignore")}, IResource.DEPTH_ZERO, DEFAULT_MONITOR); + commitProject(project); + project.getFolder("ignored").create(false, true, DEFAULT_MONITOR); + assertModificationState(project, null, true); + + // Checkout a copy and add the file to ensure it is ignored + // Check the project out under a different name + IProject copy = checkoutCopy(project, "-copy"); + waitForIgnoreHandlerCompletion(); + assertModificationState(copy, null, true); + copy.getFolder("ignored").create(false, true, DEFAULT_MONITOR); + assertModificationState(copy, null, true); + } } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java index 1724d6a46..c333f7d8d 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/unit/CheckoutOperationTests.java @@ -142,7 +142,6 @@ public class CheckoutOperationTests extends EclipseTest { } private void run(CVSOperation op) throws CVSException, InterruptedException { - op.setCVSRunnableContext(new HeadlessCVSRunnableContext()); - op.run(); + executeHeadless(op); } } |