user229758
user229758

Reputation: 11

CVS silently brings back deleted code during update

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?

Upvotes: 1

Views: 164

Answers (1)

kdgregory
kdgregory

Reputation: 39606

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.

Upvotes: 1

Related Questions