Skip to main content.
Google custom search

Working with CVS branches

Working with CVS branches

About this file (top)

Chris Demetriou writes: So, a bunch of you often do CVS branch stuff. Below are the commands that I generally use to do branch stuff (creation, updating). Jason asked me to send them here.

Assuming ${b} == the branch name and ${m} == the module name covered by the branch. I assume that whole hierarchies will be worked with, rather than individual bits as some people seem to want to do. I've never had much luck with the latter.

To create a branch (top)

  1. Tag the set of sources you want to branch with a command like:

    cvs rtag -r HEAD ${b}-base ${m}

  2. Branch them with the command:

    cvs rtag -b -r ${b}-base ${b} ${m}

Update the branch to reflect changes in the trunk (top)

  1. Update your working source tree to be on the branch:

    cvs update -P -r ${b}

    (in your working source tree)

  2. Make a tag which represents the new base you're moving to:

    cvs rtag -F -r HEAD ${b}-nbase ${m}

    This allows you to punt, and redo your merge again later if you decide you don't have time to do it right then, or whatever.

  3. Merge changes between the old and new base of your branch:

    cvs update -j ${b}-base -j ${b}-nbase

    (in your working source tree)

  4. Merge conflicts, etc.

  5. Check in your changes (to the branch).

  6. Repoint the base tag at the new base revisions:

    cvs rtag -F -r ${b}-nbase ${b}-base ${m}
  7. If no regular syncs with HEAD are expected, delete the new base tags:

    cvs rtag -d ${b}-nbase ${m}