A.3. Anonymous CVS

A.3.1. Introduction

Anonymous CVS (or, as it is otherwise known, anoncvs) is a feature provided by the CVS utilities bundled with FreeBSD for synchronizing with a remote CVS repository. Among other things, it allows users of FreeBSD to perform, with no special privileges, read-only CVS operations against one of the FreeBSD project's official anoncvs servers. To use it, one simply sets the CVSROOT environment variable to point at the appropriate anoncvs server, provides the well-known password ``anoncvs'' with the cvs login command, and then uses the cvs(1) command to access it like any local repository.

While it can also be said that the CVSup and anoncvs services both perform essentially the same function, there are various trade-offs which can influence the user's choice of synchronization methods. In a nutshell, CVSup is much more efficient in its usage of network resources and is by far the most technically sophisticated of the two, but at a price. To use CVSup, a special client must first be installed and configured before any bits can be grabbed, and then only in the fairly large chunks which CVSup calls collections.

Anoncvs, by contrast, can be used to examine anything from an individual file to a specific program (like ls or grep) by referencing the CVS module name. Of course, anoncvs is also only good for read-only operations on the CVS repository, so if it's your intention to support local development in one repository shared with the FreeBSD project bits then CVSup is really your only option.

A.3.2. Using Anonymous CVS

Configuring cvs(1) to use an Anonymous CVS repository is a simple matter of setting the CVSROOT environment variable to point to one of the FreeBSD project's anoncvs servers. At the time of this writing, the following servers are available:

Since CVS allows one to ``check out'' virtually any version of the FreeBSD sources that ever existed (or, in some cases, will exist :-), you need to be familiar with the revision (-r) flag to cvs(1) and what some of the permissible values for it in the FreeBSD Project repository are.

There are two kinds of tags, revision tags and branch tags. A revision tag refers to a specific revision. Its meaning stays the same from day to day. A branch tag, on the other hand, refers to the latest revision on a given line of development, at any given time. Because a branch tag does not refer to a specific revision, it may mean something different tomorrow than it means today.

Here are the branch tags that users might be interested in (keep in mind that the only tags valid for the ports collection is HEAD).

HEAD

Symbolic name for the main line, or FreeBSD-CURRENT. Also the default when no revision is specified.

RELENG_4

The line of development for FreeBSD-4.X, also known as FreeBSD-STABLE.

RELENG_3

The line of development for FreeBSD-3.X, also known as 3.X-STABLE.

RELENG_2_2

The line of development for FreeBSD-2.2.X, also known as 2.2-STABLE. This branch is mostly obsolete.

Here are the revision tags that users might be interested in. Again, none of these are valid for the ports collection since the ports collection does not have multiple revisions.

RELENG_4_1_1_RELEASE

FreeBSD 4.1.1.

RELENG_4_1_0_RELEASE

FreeBSD 4.1.

RELENG_4_0_0_RELEASE

FreeBSD 4.0.

RELENG_3_5_0_RELEASE

FreeBSD-3.5.

RELENG_3_4_0_RELEASE

FreeBSD-3.4.

RELENG_3_3_0_RELEASE

FreeBSD-3.3.

RELENG_3_2_0_RELEASE

FreeBSD-3.2.

RELENG_3_1_0_RELEASE

FreeBSD-3.1.

RELENG_3_0_0_RELEASE

FreeBSD-3.0.

RELENG_2_2_8_RELEASE

FreeBSD-2.2.8.

RELENG_2_2_7_RELEASE

FreeBSD-2.2.7.

RELENG_2_2_6_RELEASE

FreeBSD-2.2.6.

RELENG_2_2_5_RELEASE

FreeBSD-2.2.5.

RELENG_2_2_2_RELEASE

FreeBSD-2.2.2.

RELENG_2_2_1_RELEASE

FreeBSD-2.2.1.

RELENG_2_2_0_RELEASE

FreeBSD-2.2.0.

When you specify a branch tag, you normally receive the latest versions of the files on that line of development. If you wish to receive some past version, you can do so by specifying a date with the -D date flag. See the cvs(1) man page for more details.

A.3.3. Examples

While it really is recommended that you read the manual page for cvs(1) thoroughly before doing anything, here are some quick examples which essentially show how to use Anonymous CVS:

Example A-1. Checking out something from -CURRENT (ls(1)) and deleting it again:

    % setenv CVSROOT :pserver:anoncvs@anoncvs.FreeBSD.org:/home/ncvs
    % cvs login
    At the prompt, enter the password ``anoncvs''.
    % cvs co ls
    % cvs release -d ls
    % cvs logout
         

Example A-2. Checking out the version of ls(1) in the 3.X-STABLE branch:

    % setenv CVSROOT :pserver:anoncvs@anoncvs.FreeBSD.org:/home/ncvs
    % cvs login
    At the prompt, enter the password ``anoncvs''.
    % cvs co -rRELENG_3 ls
    % cvs release -d ls
    % cvs logout
         

Example A-3. Creating a list of changes (as unified diffs) to ls(1)

    % setenv CVSROOT :pserver:anoncvs@anoncvs.FreeBSD.org:/home/ncvs
    % cvs login
    At the prompt, enter the password ``anoncvs''.
    % cvs rdiff -u -rRELENG_3_0_0_RELEASE -rRELENG_3_4_0_RELEASE ls
    % cvs logout
         

Example A-4. Finding out what other module names can be used:

    % setenv CVSROOT :pserver:anoncvs@anoncvs.FreeBSD.org:/home/ncvs
    % cvs login
    At the prompt, enter the password ``anoncvs''.
    % cvs co modules
    % more modules/modules
    % cvs release -d modules
    % cvs logout
         

A.3.4. Other Resources

The following additional resources may be helpful in learning CVS:

For questions about FreeBSD, e-mail <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.