Skip to content

Rhaptos Software Development

Personal tools
You are here: Home » Developer Blog » Ross's Bits » So, you want branches?

So, you want branches? So, you want branches?

Document Actions
Submitted by reedstrm. on 2005-08-15 17:26. DevelopmentMaintenance
A brief "how to make branches in CVS"

The CVS Branching Foxtrot:

Starting with a CVS checkout, which contains (or will contain) changes you wish to put on a branch -
Move up the checkout tree to the highest directory that contains all of the code you wish to be on the same branch (and share the same tag). Now, pick a tagand branch name to describe your changes, and apply the following CVS commands. For example, I have code in RisaRepository and RisaModuleStorage that should be tagged together, so I cd to software/zope, and decided the right tag name is "search-match-allterms". Now, I do these steps:

0. cvs update RisaRepository RisaModuleStorage

    • resolve any conflicts
    • I find them with this:
      cvs status -v 2>/dev/null | grep ^File | grep -v Up-to-date
  1. cvs tag search-match-allterms-base RisaRepository RisaModuleStorage
    • This creates a tag for the branch point, so you can easily diff between the tip of the branch you're creating and the state of the code before you branched. The tag name is "search-match-allterms-base". Our general policy is to create this tage as <foo>-base, indicating it marks the base of a branch.
    • After the tag name, include all the affected folders you need to tag. If that's a single folder and you're inside it, you can omit the folder names entirely.
  2. cvs tag -b search-match-allterms-branch RisaRepository RisaModuleStorage
    • the -b option to cvs creates a branch.
    • Note how the branch name matches the tag name above, with -branch substituted for -base.
  3. cvs update -r search-match-allterms-branch RisaRepository RisaModuleStorage
    • Make sure you use the -branch tag, not the -base tag!
    • should be no conflicts (you fixed them before step 1, remember?)
    • you are now on the branch in these directories ('cvs status -v filename' shows a sticky tag)
  4. cvs commit RisaRepository RisaModuleStorage
    • You can now do a simple commit, since the update above put your tree onto the branch.

If all your changes are in one folder, the above commands can be simplified by changing into that folder, and omitting the target names.

Re: So, you want branches?

Posted by kclarks at 2005-08-16 17:41
Good tutorial... It worked very well for me... well, for the most part. Now you want to do one on adding? I don't seem to be able to do that successfully.
Developer Blog
« August 2008 »
Su Mo Tu We Th Fr Sa
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
2008-08-14
15:42-15:42 Signing on to Jabber from multiple locations
Categories:
Content (55)
Copyright (0)
Deep Code (3)
Development (200)
Markup (22)
Metadata (1)
Printing (7)
Style (9)
Testing (2)
Usability (6)