BSD daemon

NetBSD Developer Documentation:

Working with CVS branches

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:

  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}

To update the branch to reflect changes in the trunk:

  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. Delete the new base tags (now redundant):

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


Up to CVS Repository Issues
NetBSD Home Page
NetBSD Developer Documentation

(Contact us) $NetBSD: branch.html,v 1.7 2003/07/23 16:35:10 keihan Exp $
Copyright © 1994-2003 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.