Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 35997

Summary: (PatchAttached)[CVS Watch/Edit] "Team Edit" should set temporary watch
Product: [Eclipse Project] Platform Reporter: stefan
Component: TeamAssignee: Platform-VCM-Inbox <platform-vcm-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P4 CC: andrewsc, Bruce.Gibbons, sales
Version: 2.1Keywords: helpwanted
Target Milestone: 3.2 M2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 109780    
Attachments:
Description Flags
Patch to org.eclipse.team.cvs.core project to allow for (optional) Temporary Edit watches.
none
Patch to org.eclipse.team.cvs.ui project to allow for temporary edits at commit time. none

Description stefan CLA 2003-04-02 16:42:40 EST
You can set up the cvs repository to use temporary watches while
editing files with the "cvs watch on" command.

When I use "cvs.exe" or WinCVS to edit a file with

> cvs edit foo.txt

I will show up on the editors list

> cvs editors
> foo.txt  myuserid  Wed Apr  2 16:34:41 2003 GMT myhost mypath

and CVS automatically puts a temporary watch on the file

> cvs watchers
> foo.txt    myuserid    tedit    tunedit    tcommit

This is necessary for the CVS notification mechanism to work.
You can configure the "CVSROOT/notify" file to send a "CVS notification" 
e-mail when somebody else edits, commits or unedits the same file. 
This is all standard CVS stuff.

I have always thought that these temporary watches are set
automatically by the CVS pserver, but today I realized that
this does not seem to be the case:

When I use "Team -> Edit" in Eclipse I am added to the
editors list, as can be seen by using "Team -> Show editors"
or running "cvs editors" or using WinCVS.

But when I call "cvs watchers" the temporary watch is not there.
It follows that the "cvs notification" mails are never sent,
which is really annoying, because it works when using WinCVS
or "cvs.exe".

Is this a feature of the cvs client and not the server?

Those temporary watches and the notification
e-mails can really be quite useful.

"Team -> Edit" should behave like "cvs edit" and put a
temporary watch on the edited resource if temporary watches
have been turned on with "cvs watch on" in the repository. 

Careful, this is different than using "cvs watch foo.txt" to put
a permanent watch on a file. This too seems to be missing in eclipse.
Comment 1 Andre CLA 2003-10-02 11:38:19 EDT
IMHO this is not an enhancement but a bug!

See http://www.loria.fr/~molli/cvs/doc/cvs_10.html#SEC86 for the description of
an approrpriate "cvs edit".

It has to set a "watch".

This is even more necessary as other cvs clients rely on this.
Comment 2 Andrew Craig CLA 2004-08-13 12:45:13 EDT
From looking at this -- it seems that the 'EUC' operator on the notify isn't
being sent.  (I don't have a copy of the Eclipse src downloaded, so I just ran
ethereal to compare what was different).

Using the 'CVS' command, The entry that gets sent is :

Directory .
/src/cvs/CVSROOT
Notify users
E    Fri Aug 13 17:30:16 2004 GMT falcon /home/andrew/workspace/CVSROOT EUC

When using Eclipse, the entry that gets sent is :

Root /src/cvs
Global_option -r
Directory .
/src/cvs/CVSROOT
Notify users
E    13 Aug 2004 17:31:05 GMT falcon /home/andrew/workspace/CVSROOT
Directory .
/src/cvs/CVSROOT
noop

From looking at http://www.elegosoft.com/cvs/cvsclient.html - it shows that EUC
is required for Edit/Unedit/Commit watches.

Given that Eclipse has an option "Send Watch/Edit", but the Watch part is being
ignored, I am assuming this is a bug not a feature, that the EUC entries aren't
being sent.
Comment 3 Michael Valenta CLA 2005-01-26 15:40:29 EST
*** Bug 83758 has been marked as a duplicate of this bug. ***
Comment 4 Michael Valenta CLA 2005-05-09 14:39:29 EDT
There is currently no plan to address this item.
Comment 5 Andrew Craig CLA 2005-08-05 05:25:27 EDT
Created attachment 25737 [details]
Patch to org.eclipse.team.cvs.core project to allow for (optional) Temporary Edit watches.

I took a look to see what would be involved in getting temporary edit watches
to work within Eclipse.  I've put together two patches, one for the cvs core
project, and one for the cvs UI project.

One issue I had which may want further looking at is a StackOverflowException
occurs within CVSCoreFileModificationValidator which I prevented by stopping
the recursion if the two classnames were the same, but without knowing more
details about how the callbacks of Eclipse works that may not be a valid
assumption!
Comment 6 Andrew Craig CLA 2005-08-05 05:26:20 EDT
Created attachment 25738 [details]
Patch to org.eclipse.team.cvs.ui project to allow for temporary edits at commit time.

(Second patch)
Comment 7 Andrew Craig CLA 2005-08-05 09:04:16 EDT
After some further investigation -- the StackOverflowError was because I was in
between stable revisions (I put the changes into the HEAD of the projects). 
When updating to the HEAD again, or using the R3_1 version as the basepoint, I
did not need the StackOverflow correction code.
Comment 8 Michael Valenta CLA 2005-08-05 09:44:00 EDT
Reopening to consider patch
Comment 9 Michael Valenta CLA 2005-08-05 09:44:56 EDT
Thanks for the patch. I won't have a chance to have a look at this before M1 
(next week) so I'll have a look during M2. 
Comment 10 Michael Valenta CLA 2005-08-11 10:49:08 EDT
Patch Released. Thanks Again.

Also, I made a few minor modifications:

1) Move preference to watch edit preference page
2) Moved the setting of the notification to CVSTeamProvider so the change was 
only required in one place instead of 2.
3) Made the core preference a preference setting instead on an instance 
variable
Comment 11 Andrew Craig CLA 2005-08-11 11:02:40 EDT
Thanks -- I am not particularly fluent with "under the covers" of Eclipse which
is why I probably didn't have a few things in the right place.  
I agree that the preference setting should be a sub-section of Watch/Edit rather
than the core preference screen.

Will this be in 3.1M2?


Comment 12 Michael Valenta CLA 2005-08-11 11:29:35 EDT
Yes. It will also be in next weeks integration build which should be available 
next Tuesday if you don't want to wait the six weeks until M2.