1 Changes should be committed to the CVS HEAD only when they are in a
2 working state. The definition of "working" is somewhat liquid; a good
3 guiding principle is that anyone checking out HEAD should receive a
4 checkout of working software.
6 When you want to work on changes that are likely to temporarily break
7 large swathes of code, you should probably work on a private branch.
8 Since CVS branching and merging is something of a black art, here are
9 some simple step-by-step instructions for creating and using a branch.
11 To create your private branch:
13 # Get most up-to-date tree before branching
15 # Create a branch called "my-branch"
17 # Switch working copy to the "my-branch" branch
18 cvs update -r my-branch
20 At this point you'll be on a branch called "my-branch". Any changes
21 you make will not affect people working on HEAD, or on other branches.
23 Use name for your branch that is both descriptive and unique.
24 Starting the branch name with your SourceForge username
25 (e.g. "mcb30-realmode-redesign") is a good idea.
27 When you want to merge the changes on your branch back into HEAD, do
30 # Ensure there are no not-yet-checked-in modifications in your tree)
32 # Tag the merge point in the "my-branch" branch
33 cvs tag -c my-branch-merge-1
34 # Switch working copy back to HEAD
36 # Merge changes from the branch
37 cvs update -j my-branch
38 # Commit merged changes to HEAD
41 If you then want to continue working further on the "my-branch" branch,
44 # Switch working copy back to the "my-branch" branch
45 cvs update -r my-branch
47 and then when you want to merge some more changes back to HEAD:
49 # Ensure there are no not-yet-checked-in modifications in your tree)
51 # Tag the merge point in the "my-branch" branch
52 cvs tag -c my-branch-merge-2
53 # Switch working copy back to HEAD
55 # Merge changes from the branch
56 cvs update -j my-branch-merge-1 -j my-branch
57 # Commit merged changes to HEAD
60 Note that the format of the "merge changes from the branch" command has
61 changed, because this time you need to only merge changes since the last
64 When you have finished with your branch and merged all the changes
65 back to HEAD, simply stop using the branch.