[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cvs add (resurrect) incompatibilities

From: Frank Hemer
Subject: cvs add (resurrect) incompatibilities
Date: Wed, 20 Oct 2004 18:29:02 +0200
User-agent: KMail/1.6.2

I just discovered a bug when running cvs add on a file that was previously 
removed but not jet commited. This only happens in :ext: and :pserver: mode.

The bug was introduced with the change of add.c from version to, it appears to be a side effect of using write_letter.

Startup with:

cvs -d :ext/pserver:user@server:/CVSROOT -r co test
cd test
cvs remove -f test.txt
cvs add test.txt

When running cvs on a local repository, the server response looks 
U test.txt
cvs add: test.txt, version, resurrected

When running via :ext: or :pserver:, the response looks like:
cvs add: test.txt, version, resurrected
U test.txt

An ugly side effect is that resurrect will re-add the file in rw-mode while 
previous cvs-versions properly re-added it in ro-mode (provided it was 
formerly checked out ro).

I looked through the code, and it appears that the server properly returns the 
MT message first (containing the 'U test.txt') and the error output 
handle_mt doesn't output the 'U test.txt' message but instead sets 
updated_fname. Finally this is handled by handle_create and therewith by 
call_in_directory, and these calls happen _after_ the error output. So in 
this case it is not a matter of stdout/stderr but a bug in the server 
protocol/protocol usage.

Possible fix:
I'm not sure whether I understand correctly but it appears that the function 
name write_letter is somehow misleading as it doesn't only write a letter if 
the letter is 'U'. I exchanged the 'U' so write_letter doesn't write the 
'-update' tag info and all works correct.
Probably add.c should have its own implementation of write_letter and 
shouldn't use the one in update.c to fix this?

Unfortunatelly the file still is re-added in rw-mode, but this seems to be a 
problem elsewhere because the global -r option (for the add cmd) is ignored 

If you come up with a fix please let me know, otherwise I can send a patch 
with a separate add.c write_letter implementation but this wouldn't fix the 
re-add rw problem.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]