bugConcurrent Versions System - Bugs: bug #23370, cvs watch will be wrongly cleared...

 
 

bug #23370: cvs watch will be wrongly cleared by cvs co by the same user

Submitter:  Peter Toft <petoft>
Submitted:  Mon 26 May 2008 10:26:43 PM UTC
Votes: 50
 
Category:  Bug Report Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release: 
Fixed Release:  None Fixed Feature Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 04 Nov 2009 06:58:34 PM UTC, comment #4: 

I've attached a modified version of update.c, which was downloaded from the 1.11.23 sources.  I've commented out 5 lines of code, which I believe are the culprit for this bug, (at least the comment directly above them indicates so)..


(file #18988)

Jesse Hopkins <hops>
Tue 03 Nov 2009 03:12:09 PM UTC, comment #3: 

This is severely impacting our workflow.  Our group does a lot of development in graphical, model-based software tools, and those files cannot be merged easily.  We rely heavily on cvs-edit commands, and the fact the the edits are being cleared is causing us lots of grief.

I have attempted to create a workaround using the CVS scripting hooks, and I've got a solution that almost works, but doesn't quite make the cut.

Here is an overview of what I've attempted so far.  CVS stores the edit/watch info inside the repository in CVS/fileattr files for each directory in CVS.  The "notify" administrative file allows programs to be run whenever a user performs cvs-edit or cvs-unedit.  I was able to create a perl-script that was run via notify that created a copy of all fileattr files affected by the unedit or edit command.  The fileattr files were copied into a "fileattribbackup" subdirectory of CVSROOT, which mimics the directory structure of the actual repository.

The next step is to then copy the "backup" fileattr files stored in CVSROOT into the repository whenever a user performs a checkout, which can be performed by specifying the perl script to run in the "modules" file.

Now, the problem I'm facing is that when my script is called from "notify", CVS has not yet modified the fileattr files, so the files that get copied into the CVSROOT backup area are basically 1-rev behind.  This is my major roadblock at this point.  Does anyone have better ideas of how to handle this?

Another idea I was throwing around was to monitor all of the "fileattr" files for changes in a continuously running process, which would copy them to the backup location when they change.  Then the checkout script could run as before.  This seems like asking for trouble (at least more than the previous solution), because then I need to deal with cvs locks and such.

Jesse Hopkins <hops>
Wed 25 Mar 2009 11:40:01 PM UTC, comment #2: 

it seems directly connected to this problem (posted to -email is unavailable- 2009-03-25 22:57 CET):

Assume that sandbox 1 and sandbox 2 are two different directories e.g. for development and the other for testing.                             
                                                                                                                                              
User A in sandbox 1:
--------------------                                                                                                                         
$ cvs edit foo.txt
$ cvs editors foo.txt
foo.txt A       Wed Mar 25 21:48:32 2009 -0000 serenity.petertoft.dk /home/A/foocvs1
                                                         
                                                                                                                                              
User B
--------------------                                                                                                                          
$ cvs update -A foo.txt
$ cvs update -r 1.1 foo.txt
$ cvs update -A foo.txt
$ cvs editors foo.txt
<as many updates as you want - no problems>
foo.txt A       Wed Mar 25 21:48:32 2009 -0000  serenity.petertoft.dk /home/A/foocvs1
                                                                                                                                              
User A in sandbox 2:
--------------------                                                                                                                          
$ cvs update -r 1.1 foo.txt
$ cvs update -A foo.txt
$ cvs editors foo.txt
## NO LOCK on foo.txt - BUMMER - the lock should have been kept ##

Peter Toft <petoft>
Wed 25 Mar 2009 11:21:22 AM UTC, comment #1: 

I appreciate that most cvs users don't make use of cvs edit, however for those of us that do this bug is a real pain.

We use TortoiseCVS in conjunction with WinMerge as a front end to cvs. Unfortunately the act of comparing historical revision changes on a file with WinMerge results in a checkout operation behind the scenes in a temporary directory, conseqently your cvs watch is cleared.

Gareth Williams <garethawilliams>
Mon 26 May 2008 10:26:43 PM UTC, original submission:  

In the example below I will demonstrate that the cvs "locks" functionality will be wrongly cleared by CVS version 1.12.13, when the same user who did the lock (using cvs edit) later does a "cvs checkout" or "cvs export".

Since such additional "cvs export" operations easily can be a part of daily operations it is a very destructive bug in CVS. Especially problematic it is for non-mergeable files, when a multi-site CVS work group is using "cvs watch on+cvs edit" to signal, who is working where.

Operations as user "pto" who makes a watch+edit
-----------------------------------------------
$ cvs checkout my_proj
... lots of check out lines...
$ cd my_proj
$ cvs watch on README.txt
$ rm README.txt
$ cvs update README.txt
$ ls -l README.txt
-r-r--r-- 1 pto pto 6 2008-05-26 23:41 README.txt
$ cvs editors README.txt  # No files will be shown since no files are locked
$ cvs edit README.txt    
$ cvs editors README.txt  # Good I can see pto is locking "README.txt"
README.txt    pto        Wed May  7 06:43:15 2008 -0000 myworkstation    /opt/cvsroot/my_proj
                         
Operations as another user "joe"
--------------------------
$ cvs checkout my_proj
$ cd my_proj
$ cvs editors README.txt
README.txt    pto        Wed May  7 06:43:15 2008 -0000 myworkstation    /opt/cvsroot/my_proj
                          # Good I can see pto is locking "README.txt" - no problems


Operations as user "pto"
--------------------------
$ mkdir MY_SECRET_PLACE_OR_SOMEWHERE_ELSE
$ cd MY_SECRET_PLACE_OR_SOMEWHERE_ELSE
$ cvs checkout my_proj
$ cd my_proj
$ cvs editors README.txt
                          # WHAT THE... ??? - the lock on my_proj/README.txt is gone.... :-((


Note that the same problem exist when you replace the
second "cvs checkout" with "cvs export"

In the example above after "cvs edit README.txt" both
$CVSROOT/my_proj/CVS/fileattr and my_proj/CVS/Baserev show that
the file is being edited, after doing another cvs co
$CVSROOT/my_proj/CVS/fileattr does not show the file being edited
anymore but my_proj/CVS/Baserev does -> thus we have a mismatch.


Change wish:
------------
The "correct" operation by CVS would be NOT to clear the CVS locks, when doing more than one "cvs co" or "cvs export" by the same user.

Peter Toft <petoft>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #18988:  update.c added by hops (87KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hops (Posted a comment)
  • -email is unavailable- added by garethawilliams (Posted a comment)
  • -email is unavailable- added by garethawilliams (Voted in favor of this item)
  • -email is unavailable- added by petoft (Submitted the item)
  •  

    There are 50 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-11-04 hops Attached File- Added update.c, #18988
    2009-03-25 garethawilliams Carbon-Copy- Added garethawilliams

    Back to the top

    Powered by Savane 3.13-54b4.
    Corresponding source code