Maintaining two synced CVS repositories
---------------------------------------

The idea

Mobilizer contains both open-source code and closed-source
code. Therefore, Mobilizer requires two distinct CVS repositories. The
first is the Mobilizer CVS repository, which contains all files
releveant to the Mobilizer project. The second is the Sourceforge CVS
repository, which contains only the open-source files from the
Mobilizer CVS repository.

The Mobilizer CVS repository consists of the main trunk and the public
branch. The main trunk contains the code we work on from day to
day. The public branch contains the code of the stable releases, open
for the public to contribute to.

The Sourceforge CVS repository has only a main trunk, which contains a
copy from the Mobilizer CVS repository's public branch. If the public
branch needs to be modified, this is done in the Sourceforge CVS
repository.

Every time we reach some sort of milestone (a release), the public
branch is merged with the main trunk, and the new leaf on the main
trunk is copied to become a new public branch:

 --- 1.1 ------------ 1.2 ---   main trunk
      |              / |
   1.1.1 ----- 1.1.2 --+-----   public branch
                       |
                    1.2.1 ---   new public branch

To avoid conflicts, any changes made to the public branch should be
checked into the trunk as soon as possible and vice versa. So
regularly creating a new public branch is important ("release early,
release often").


The implementation

Creating the first public branch:

1. Check out/update the main trunk from the Mobilizer CVS repository.
2. Create a new public branch.
3. Copy the new public branch from the Mobilizer CVS repository to the
   main trunk of the Sourceforge CVS repository.

Creating Subsequent public branches:

1. Copy the main trunk from the Sourceforge CVS repository to the
   public branch in the Mobilizer CVS repository.
2. Merge the public branch with the main trunk.
3. Create a new public branch.
4. Copy the new public branch from the Mobilizer CVS repository to the
   main trunk of the Sourceforge CVS repository.

Creating a new public branch (release) in the Mobilizer CVS
repository:

$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs tag -b release_1

Checking out a public branch:

$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs checkout -r release_1 mobilizer-release1

Merging the public branch into the main trunk:

# Retrieve working copy from the main trunk.
$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs checkout mobilizer

# Go to the working copy.
$ cd mobilizer

# Merge all changes made on the branch
# into the working copy.
$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs update -j release1 .

# Commit working copy.
$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs commit -m "Merged public branch."

Importing the public branch from the Mobilizer CVS repository as the
main trunk into the Sourceforge CVS repository:

$ cvs -d:ext:catchy@cvs.mobilizer.sourceforge.net:/cvsroot/mobilizer import -m "Imported public branch." mobilizer-release1 catchy release1

Importing the main trunk from the Sourceforge CVS repository as the
public branch into the Mobilizer CVS repository:

$ cvs -d:ext:catchy@cvs.mobilizer.sourceforge.net:/cvsroot/mobilizer export -r collect_release1 -d mobilizer-release2

$ cvs :pserver:pascal@awacs.dhs.org:/home/cvs import -m "Imported public branch." mobilizer-release2 catchy release2

