Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-09-25 17:16:14


Actually, if anyone with CVS expertise would care to comment, my analysis is
appended to this message. I would appreciate feedback, in case I got
something wrong. If you're not interested in details and just want to see
the conclusion, skip to the end of the message.

-Dave

----- Original Message -----
From: "Beman Dawes" <bdawes_at_[hidden]>

> Yes, the main trunk got removed because we didn't want development code
> appearing in the main trunk.
>
> We have some notes on how to create a branch without also creating a main
> trunk, but Dave just tested them and they don't appear to work
> anymore. Dave's may try to develop a new procedure.

-------------------------

The experiments show that CVS can't really create a branch on a directory
(module), but only on files. So if you try to branch a module with no files,
it has no effect. Unfortunately, if you add (but don't commit) a file foo in
that module, CVS complains "nothing known about foo", and aborts. So, there
are several options for adding a module on a branch:

1. create the branch also on one or more existing files under revision
control, or modules which actually contain files, then when the procedure is
finished, delete the branch from those siblings:

cd existing-module
cvs add ./new-module
cvs tag -b my_branch ./new-module ./sibling-module # ./ is optional
cvs update -rmy_branch ./new-module
cd new-module
cvs add * # add the files
cd ..
cvs tag -d my_branch ./sibling-module

2. Add one or more files F on the main trunk, then create the branch, update
on the branch, add the new module's files and commit. Update F on the main
trunk if neccessary and remove it:

cd existing-module
cvs add ./new-module
cd new-module
echo > dummy # create a dummy file
cvs add dummy
cvs commit -m "dummy file" dummy

cvs tag -b my_branch # tag whole directory
cvs update -rmy_branch
cvs add * # might have to leave dummy out of the list explicitly
cvs update -A dummy # Get dummy back to main trunk
rm dummy # must remove file before "cvs remove"
cvs remove dummy

I suppose there are any number of variations on this scheme. It doesn't
appear to matter where in the repository the files are located that get
associated with the branch, but they have to exist and be committed in the
repository. Also, they must not be in parent directories of the place where
the branch command is issued.

Beman, I would be happy to make a script and/or write up directions, but I'd
like to collaborate with someone on what the /best/ procedure would be. For
example, we could tell people to always use index.html to ensure the branch
can be created:

cd boost-root/libs
cvs add ./new-module
cd boost-root
cvs tag -b new_branch index.htm libs/new-module
cvs update -rnew_branch libs/new-module
cvs tag -d new_branch index.html # remove branch from index.html
cvs add libs/new-module/*

This seems like a good strategy because the harm of having extra branches
lying around on index.htm is extremely limited, and the procedure includes a
very quick deletion of the branch once it's been created.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk