[ds6-devel] refactoring

Chris Leishman chris at leishman.org
Tue Jan 14 10:13:54 CET 2003


On Monday, January 13, 2003, at 11:50 PM, Mauro Tortonesi wrote:

> On Mon, 13 Jan 2003, Chris Leishman wrote:
>
>> On Monday, January 13, 2003, at 10:06 PM, Mauro Tortonesi wrote:
>>
>>>
>>> i have just created a new branch for nc6: mauro_refactor_130103. i 
>>> have
>>> made a major refactoring of network.c.
>>
>> Actually - you commited your refactor onto the HEAD branch.  Don't
>> worry - I just fixed it for you.
>
> aaaaaargh! how can you handle all this branches stuff without going 
> crazy?
> it is really too much complicated for me... <:-(

Years of practice I guess ;)
In one of the last major projects I worked on there was usually half a 
dozen branches going on at any one time.  We used to just keep a list 
of them on a whiteboard, and we also had a CVS master who kept a list 
of all the merges.

Anyway, I usually just check each branch out into it's own directory:

eg:
cvs -d ds6chris at deepspace6.net:/cvs co -d nc6.i18n -r i18n nc6

Whenever I want to make a branch, I do:
cvs tag <branch>_base
cvs tag -b <branch>

then I go check that branch out to do my editing in.  If you don't want 
to check out another copy, then you just have to do "cvs up -r 
<branch>" to move into that branch.

Also, another good one to remember is the rules for merging branches.  
A merge of changes in the head back into your branch should go 
something like:

The first time you merge from the head:
cvs up -kk -j HEAD
cvs rtag -rHEAD <branch>_last_HEAD_merge <module>
(or change to the checked out HEAD version and just use "cvs tag", 
which is what I usually do)

Then future times:
cvs up -kk -j <branch>_last_HEAD_merge -j HEAD
cvs rtag -F -rHEAD <branch>_last_HEAD_merge <module>

Going the other way (branch back to head):

cvs tag pre_<branch>_merge
cvs up -j <branch>
cvs rtag -r <branch> last_<branch>_merge  (optional depending on 
whether changes on the branch will continue)

Regards,
Chris



More information about the ds6-devel mailing list