Rost
Rost

Reputation: 9089

CVS merging diff between two revisions from trunk to branch results in file removal instead of merge

I'm trying to merge recent trunk changes to branch. From branch working directory I'm performing merge update command (merge diff between trunk revisions to branch):

cvs update -j 1.207 -j 1.208 file.cpp

But instead of merging CVS just removes the updated file:

cvs update: scheduling `file.cpp' for removal

I'm sure the file wasn't removed or moved to another directory. Local file revision is 1.203.8.1.

Why it doesn't merge and how can I do it another way?

Upvotes: 1

Views: 759

Answers (1)

Rost
Rost

Reputation: 9089

The problem was that I forgot about CVS servers replication. We have several local office repositories replicated from central one. I checked in to trunk on central CVS server, but performed update from local one. Changes weren't replicated yet and requested file revision just didn't existed yet in local repository. After some period of time replication was done and merge command completed successfully.

But what actually makes me mad is that CVS doesn't return error about non-existent revision but just treats it as if file was removed from repository!

Fortunately CVS returns error for non-existent tag, so to make sure your check-in presents in repository you can use next command (WinCVS, Windows platform):

cvs update -p -rYourCheckinTag file.cpp>nul

In case of failure CVS will return descriptive error message:

cvs [update aborted]: no such tag `YourCheckinTag'

In case of success CVS will return file repository path and requested revision number:

===================================================================
Checking out file.cpp
RCS:  /projects/file.cpp,v
VERS: 1.208
***************

Upvotes: 1

Related Questions