views:

39

answers:

1

Our team has noticed that CVS brings back deleted code if you have changes in your working file within the block of code that has been deleted. CVS does this silently without presenting the merge conflict markings.

Does anyone have a work around for this?

Is there a clever way to detect that this is about to happen?

+1  A: 

From your description, it's unclear what is happening.

If one developer deletes a chunk of code from file X, and another developer makes changes in the middle of that deleted code, and that's all that happens, then I'd be very surprised if CVS was silent -- not that it couldn't happen, but I've never seen it happen in 10+ years of using CVS.

It is possible, because of the way that CVS tracks edits, that major changes could make it think that developer #2 added the code into a completely different location. Particularly if developer #1 makes several commits before developer #2 does an update.

The best work-around is probably to check the status of files before taking an update. You can do this with the "-n" switch:

cvs -nq update -P 2> /dev/null

If you see that a file you've changed is going to be updated, then you can take a closer look at it.

kdgregory
Thanks for the answer. Developers are already instructed in our Programmer's Manual to preform "cvs -nq update" before updating to check for conflicts. I have also failed to reproduce the behavior with a simple test. I posted here to see if others have observed the same thing. The behavior must happen under rare circumstances. It would really be nice to know what they are. In the last 15 years this has probably happened 4 times. 2 in the last year.