Committing to a different branch with commit -r

Posted by Amarghosh on Stack Overflow See other posts from Stack Overflow or by Amarghosh
Published on 2010-04-30T06:27:29Z Indexed on 2010/05/03 10:08 UTC
Read the original article Hit count: 174

Filed under:
|

Does CVS allow committing a file to a different branch than the one it was checked out from? The man page and some sites suggest that we can do a cvs ci -r branch-1 file.c but it gives the following error:

cvs commit: Up-to-date check failed for `file.c'
cvs [commit aborted]: correct above errors first!

I did a cvs diff -r branch-1 file.c to make sure that contents of file.c in my BASE and branch-1 are indeed the same.

I know that we can manually check out using cvs co -r branch-1, merge the main branch to it (and fix any merge issues) and then do a check in. The problem is that there are a number of branches and I would like to automate things using a script. This thread seems to suggest that -r has been removed. Can someone confirm that?

If ci -r is not supported, I am thinking of doing something like:

  • Make sure the branch versions and base version are the same with a cvs diff
  • Check in to the current branch
  • Keep a copy of the file in a temp file
  • For each branch:
    • Check out from branch with -r
    • replace the file with the temp file
    • Check in (it'll go the branch as -r is sticky)
  • Delete the temp file

The replacing part sounds like cheating to me - can you think of any potential issues that might occur? Anything I should be careful about? Is there any other way to automate this process?

© Stack Overflow or respective owner

Related posts about cvs

Related posts about version-control