branches - quick howto

Joseph Carter knghtbrd at bluecherry.net
Tue Jul 30 20:46:40 EDT 2002


If you're just using CVS to grab the latest Twilight source, this largely
does not apply to you.  All you need to know is that cvs up -r <tag> will
get you a tag/branch and that cvs up -A returns you to the trunk.  Unless
you know otherwise, you want to be using the trunk anyway..


For coders, after carefully and by-hand reverting Zeph's changes, I've
concluded that we NEED to be using branches!  Zeph commented that branches
have not worked well in the past for people who don't know how to use them
properly, and he's right.  (I've made a few serious mistakes with branches
myself actually..)

Here's how to create a branch from the current trunk:

  cvs tag -r HEAD -b <branchname>
  cvs up -r <branchname>

This creates a branch from the current revisions of things in the trunk
(which does not affect your working copy at all) and updates your working
copy to use the branch.  Get these right or things will go WRONG WRONG
WRONG and you will be slow roasted when your commit breaks the trunk..

Now that's great if we want a bunch of little forks, but the big question
is how do we keep little forks from becoming big ones?  We merge branches
frequently, that's how.  When a branch is in a working state, merge in the
latest changes from the trunk, like so:

  cvs up -j HEAD

This may cause conflicts, and does not have the usual C at the beginning
of the line when it does so!  You should follow this by a plain cvs up
which will show you P, M, and C lines as usual.

Note that additions and removals of files are also a bit more complex when
dealing with branches.  You should be able to figure it out, but if you
can't, ask for help..


To merge into the trunk (which you should do every time your branch is
stable and thuroughly tested), make sure you have no uncommitted changes
and do this:

  cvs up -A
  cvs -j <branchname>
  cvs up   # to check for conflicts


Simple, right?  No?  Well, that's as simple as it gets for non-simple
changes which may or may not  work.  =p  Zeph and I will need to use these
extensively I'm certain.  Others may or may not need them, depending on
how far-reaching their changes are.

Please try to avoid calameties in the next week or so, I will be busy with
doctors, school, apartments, etc, etc, etc.

-- 
Joseph Carter <knghtbrd at bluecherry.net>               Crazy in the coconut
 
I'm starting to think the gene pool could use a little chlorine.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <http://icculus.org/pipermail/twilight-devel/attachments/20020730/db55add8/attachment.pgp>


More information about the twilight-devel mailing list