Community
Participate
Working Groups
When watch/edit is being used, files are checked out read-only. A file must be "cvs edited" before it can be modified. Committing the resource then resets the file to read-only by the client (I should verify this using the command line). What happens for files that are added and then committed? The modification case can be detected by looking in the Baserev file. What is done (or can be done) for adds.
When adding files in projects where watch/edit is enabled, the newly added files are not read only after the commit and thus there will no edit notification be sent to the server if the user continues to work with such a file. If you add files to CVS with watch/edit, then you have to open the project properties, uncheck 'enable watch edit', apply and recheck the property. Then all and committed files are read only. This should be an automatic behaviour on commit of added files. Richard
*** Bug 63644 has been marked as a duplicate of this bug. ***
*** Bug 36470 has been marked as a duplicate of this bug. ***
*** Bug 82960 has been marked as a duplicate of this bug. ***
Hi, Are there any plans to fix this bug? It seems to have been around for a couple of years, and users are regularly asking for a fix (hence the duplicated bug reports). I'm currently trying to migrate a team of developers from proprietary tools and pessimistic locking to using Eclipse and CVS. Issues like this are an important stumbling block to this? Thanks, Chris.
There is currently no plan to fix this bug. If it is important to you, perhaps you should consider providing a patch.
*** Bug 83752 has been marked as a duplicate of this bug. ***
What is the work around if it is not going to be fixed? Ask the user to toggle Watch/Edit twice? Ask the user to check out the folder again? Ask the user to set the file to read only with the OS?
You can manually make the file read-only on the file's properties page.
Works for me. Thanks.
We are getting complaints from our users about this bug so we took some time to fix it last week. Here is a patch for 3.1. A patch for 3.0.1 is below the batch for 3.1. Index: CommitOperation.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/u i/operations/CommitOperation.java,v retrieving revision 1.11 diff -u -r1.11 CommitOperation.java --- CommitOperation.java 22 Feb 2005 19:46:33 -0000 1.11 +++ CommitOperation.java 14 Mar 2005 13:23:33 -0000 @@ -38,6 +38,20 @@ * @see org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation#executeComma nd(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.team.internal.ccvs.core.ICVSResource[], org.eclipse.core.runtime.IProgressMonitor) */ protected IStatus executeCommand(Session session, CVSTeamProvider provider, ICVSResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException { + // if watch/edit is enabled, set files read only. + if (provider.isWatchEditEnabled()) { + for (int i = 0; i < resources.length; i++) { + ICVSResource cvsResource = resources[i]; + if (!cvsResource.isFolder()){//File handle + IResource localResource=cvsResource.getIResource(); + if ((localResource.getType())==IResource.FILE){ + if (!localResource.isReadOnly()){ + localResource.setReadOnly(true); + } + } + } + } + } return Command.COMMIT.execute(session, Command.NO_GLOBAL_OPTIONS, getLocalOptions(recurse), Index: .project =================================================================== RCS file: .project diff -N .project --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ .project 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>operations</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> Here is a patch for 3.0.1. Index: CommitOperation.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/u i/operations/CommitOperation.java,v retrieving revision 1.3 diff -u -r1.3 CommitOperation.java --- CommitOperation.java 7 Jun 2004 03:05:02 -0000 1.3 +++ CommitOperation.java 14 Mar 2005 13:15:21 -0000 @@ -72,6 +72,20 @@ * @see org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation#executeComma nd(org.eclipse.team.internal.ccvs.core.client.Session, org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.team.internal.ccvs.core.ICVSResource[], org.eclipse.core.runtime.IProgressMonitor) */ protected IStatus executeCommand(Session session, CVSTeamProvider provider, ICVSResource[] resources, IProgressMonitor monitor) throws CVSException, InterruptedException { + // if watch/edit is enabled, set files read only. + if (provider.isWatchEditEnabled()) { + for (int i = 0; i < resources.length; i++) { + ICVSResource cvsResource = resources[i]; + if (!cvsResource.isFolder()){//File handle + IResource localResource=cvsResource.getIResource(); + if ((localResource.getType())==IResource.FILE){ + if (!localResource.isReadOnly()){ + localResource.setReadOnly(true); + } + } + } + } + } return Command.COMMIT.execute(session, Command.NO_GLOBAL_OPTIONS, getLocalOptions(),
Thanks for the patch but it's really not the right way to do it. The proper place is the EclipseFile#checkedIn method since this is where it is done for the other cases.Since the nature of the change is much different from what you did, I have made the change in the proper place and released the change to HEAD. There is no plan to patch the 3.0 stream.