Cvs
Cvs
========================================================
**********************************************************************
NOTE: THESE INSTRUCTIONS ARE OUT-OF-DATE AS BRL-CAD NOW USES
SUBVERSION INSTEAD OF CVS. CONSULT WITH CAUTION AS SOME PORTIONS ARE
STILL RELEVANT BUT OTHERS THAT ARE CVS-SPECIFIC ARE NOT.
**********************************************************************
2. There is a STABLE branch that may only have code committed against
it that a) compiles on all relevant platforms, b) does not
detrimentally degrade performance, and c) runs correctly passing
available validation tests.
TABLE OF CONTENTS
-----------------
Introduction
Table of Contents
Overview
Checking out sources
from HEAD
from STABLE
from a branch/revision
Checking in sources
commit messages
to HEAD
to STABLE
to a branch/revision
Tag naming convention
for releases
for branches
Making a release
creating a maintenance branch
applying release patches
Merging a branch
merging a branch into HEAD
merging HEAD into a branch
Making a branch
Usage Tips
References
OVERVIEW
--------
It's very important that the main CVS HEAD revision be a "mostly"
stable code base so that at any given time users may download the
latest sources, get the source code to compile with minimal
effort, and have the core components mostly function as expected.
See the "Checking in sources to HEAD" section for more details.
Some users and developers will need from time to time to obtain a
relatively recent version of the sources that is certain or at
least expected to "work". This is what the STABLE branch is for.
See the "Checking in sources to STABLE" section for more
information.
There are two basic ways to check out the sources: anonymously or
as a developer. Developers have full read-write access to the
source code. Anonymous users have read-only access; and the
version of the sources checked out may actually lag the most
recent commits by several hours.
Once logged in, the access method for anonymous users will be via
:pserver: (provide an empty password if prompted). Developers
will checkout using the default implicit :ext: method and will
need to provide an authorized username. Be sure to use the "-P"
checkout option to remove (prune) empty directories. The "-z9"
global CVS option is encouraged to minimize network utilization.
FROM HEAD:
As anonymous:
cvs -z9 -d :pserver:[email protected]:/cvsroot/brlcad checkout -P
brlcad
As a developer:
cvs -z9 -d <username>@brlcad.cvs.sf.net:/cvsroot/brlcad checkout -P brlcad
FROM STABLE:
Checking out from STABLE is like checking out from any specific
revision or branch -- provide the tag name upon checkout:
As anonymous:
cvs -z9 -d :pserver:[email protected]:/cvsroot/brlcad checkout -P
-r STABLE brlcad
As a developer:
cvs -z9 -d <username>@brlcad.cvs.sf.net:/cvsroot/brlcad checkout -P -r STABLE
brlcad
FROM A BRANCH/REVISION:
As a developer:
cvs -z9 -d <username>@brlcad.cvs.sf.net:/cvsroot/brlcad checkout -P -r
<tagname> brlcad
If the tag names are not known, you can check out HEAD or STABLE
and perform a "cvs log" on any file to see the known tag names:
cd brlcad
cvs status -v README
Once you find the revision or branch tag name in question, you can
"cvs update" to that revision:
CHECKING IN SOURCES
-------------------
COMMIT MESSAGES:
TO HEAD:
It's very important that the main CVS HEAD revision be a "mostly"
stable code base so that at any given time users may download the
latest source, get it to compile with minimal effort, and have the
core components mostly function as expected. HEAD is where active
development takes places, so this necessarily means that there may
be small windows of opportunity where the sources do not compile,
but those should not persist. Likewise, since the developers
potentially and often have specific or relatively independent
development efforts, the CVS commits of one developer should be
made in a means that will have limited or understood impact on
other developers.
This minimally means that CVS commits need to at least work for
the developer committing the changes. If it's discovered that the
changes break other major supported platforms, the broken state
should not be allowed to linger. Effort and arrangements need to
be made to either resolve the problem promptly or the changes
should be reverted.
TO STABLE:
Some users and developers will need from time to time to obtain a
relatively recent version of the sources but a version that is
certain or at least expected to "work". This shall be known as
the STABLE branch. For code to make it to the STABLE branch, it
needs to pass several criteria and commits should be well
documented indicating the nature, purpose, and impact of the
change. These criteria include the following:
TO A BRANCH/REVISION:
<comment>
Note that hyphens (-) are used, not underscores. Periods (.) are
never used because they upset CVS's branch naming.
FOR RELEASES:
rel-<revision>
FOR BRANCHES:
Branches are symbolic tags that are used to denote and allow
separate isolated revisions of code. The following format
should be used for branch tags:
<keyword>[-<revision>]-branch
premerge[-<revision>][-<date>]-<comment>
Example: premerge-20040404-ansi
postmerge[-<revision>][-<date>]-<comment>
Example: postmerge-20040315-windows
<keyword>[-<revision>][-<date>]-freeze
Example: windows-20040315-freeze
<keyword>[-<revision>][-<date>]-pre
<keyword>[-<revision>][-<date>]-post
<keyword>[-<revision>][-<date>][-<comment>]
MAKING A RELEASE
----------------
This will create a unified diff patch file called "my.patch" that
is trivially applied to a checkout using the patch command:
MERGING A BRANCH
----------------
CVS branches can be both very useful or difficult. Proper usage
of branches generally requires a firm understanding of CVS
otherwise complications and mistakes are bound to happen as there
are several usage pitfalls. Following the directions shown below
should help avoid the pitfalls and assist in making effective use
of a CVS branch.
In both the checkout and the join update, the -kk flag was used to
cause CVS to not expand the CVS variables such as \$Revision\$ and
\$Id\$. If those keyword variables are expanded, you're likely to
have many conflicts depending on time-stamps.
MAKING A BRANCH
---------------
Making a branch is a matter of using the "-b" option when tagging.
Branch tags are special symbolic CVS tags that allow for isolated
changes and controlled merging of modifications.
If you want to use the latest sources on the CVS HEAD as the
starting point for your branch:
If you want to use some other tag as the starting point for
your branch:
CASE 2: You have a checked out revision with all changes committed
and you want to tag it and start using it as a branch:
cvs tag -b <keyword>-branch
cvs update -dP -r <keyword>-branch
To see all tags that have been set for a particular file in
addition to checkout status, use the "-v" status option:
USAGE TIPS
----------
0) Checkout with the -P option to prune empty directories:
cd foo
# copy the files to their new home
find . -type d -not -name CVS -exec mkdir -p ../src/foo2/{} \;
find . -type f -not -regex '.*/CVS/.*' -exec cp -p {} ../src/foo2/{} \;
cd ../src
# add the new directories to cvs
find foo2 -type d -not -name CVS -exec cvs add {} \;
find foo2 -type f -not -regex '.*/CVS/.*' -exec cvs add {} \;
# commit the new sources
cvs commit -m "moved from foo to src/foo" foo2
cd ..
# delete the old source subtree
find foo -type f -not -regex '.*/CVS/.*' -exec rm {} \;
find foo -type d -not -name CVS -exec rm -f {} \; -exec cvs delete {} \;
cvs commit -m "moved from foo to src/foo" foo
cvs update -P foo
If you don't have CVS keys set up and have too many files to
move, each find script could be passed to xargs so that only a
single password is prompted instead of one per file. Since
moving/renamed directories in CVS is "bad", though, that's left
as an exercise to the reader.
*.pix -k 'b'
You can likewise denote arbitrary files as binary via the "-kb"
option on commit:
REFERENCES
----------
This CVS policy and guidelines document was in part derived off
some of the principal ideas of other projects' usage of CVS such
as the Linux Documentation Project, the XFree86 DRI project, Zope,
FreeBSD, and AT&T's SML/NJ among others.
Zope
http://dev.zope.org/CVS/ZopeReleasePolicy
FreeBSD
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvs-tags.html
AT&T SML/NJ
http://www.smlnj.org/DEV/policy.html
http://cm.bell-labs.com/cm/cs/what/smlnj/DEV/policy.html
---
This document was initially written in 2002 and later almost
completely rewritten in 2004 by Christopher Sean Morrison.