Concurrent Versions System

From ArchWiki

From https://www.nongnu.org/cvs/:

Concurrent Versions System is a version control system, an important component of Source Configuration Management (SCM). Using it, you can record the history of sources files, and documents. It fills a similar role to the free software RCS, PRCS, and Aegis packages.

More recent alternatives are listed in Category:Version control system.

Client

If you want to connect to a cvs server, install cvs and follow instructions from the owners of that server. For example https://www.openbsd.org/anoncvs.html.

Note: See FS#12636, some servers might require rsh. You can force the usage of ssh instead with the environment variable CVS_RSH=ssh.

Graphical front-ends

  • Cervisia — GUI for CVS. Part of kde-sdk.
https://apps.kde.org/cervisia/ || cervisia

Server

This article or section is out of date.

Reason: Should explain how to run the cvs server with systemd (see Fedora's cvs.socket and cvs@.service files) instead of relying on xinetd. (Discuss in Talk:Concurrent Versions System)

This is a quick guide on how to set up the latest CVS server.

Installation

Install cvs and xinetdAUR.

Create the cvs user group - members of this group will have write access to the repository:

# groupadd cvs

Create the cvs user in the cvs group (-md makes the home directory):

# useradd -md /home/cvsroot -g cvs -p Insecure0 cvs

Initialization

Initialize your CVS repository (as cvs):

cvs% cvs -d /home/cvsroot init

The permissions on the directory (not the files inside, however) should be 2775 (drwxrwxr-x), but if not, run (as cvs):

cvs% chmod 2775 /home/cvsroot

Add any users that you want to have local access to the repository to the group cvs by using the following two steps. You can add pre-existing users to the cvs group with the command:

# gpasswd -a username cvs

Make a xinetd configuration file:

/etc/xinetd.d/cvspserver
service cvspserver
{
        port            = 2401
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        passenv         = /home/cvsroot
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/home/cvsroot pserver
}

Ensure you have the following line in /etc/services (add it if not):

cvspserver 2401/tcp

Unset the HOME variable

# unset HOME

And restart xinetd.service.

Configuration

As the cvs user, create a passwd file in ~/CVSROOT. To add entries in the file you can use htpasswd commands (present in the apache package) as follows:

htpasswd -b filename username password

then edit the file and add the group, for example:

# Format is username:password:group

anonymous::
archie:HopefullySecure0:cvs
other:Insecure0:cvs

Now create a writers file in ~/CVSROOT, which grants write privileges to the users you created in passwd:

archie
other

Now create a readers file in ~/CVSROOT, which grants read privileges to the users you created in passwd:

anonymous
Note: If a user is present in the readers file they cannot have write access too.

Usage

You can test out the server using the following commands:

$ export CVSROOT=:pserver:my_user_name@127.0.0.1:/home/cvsroot
$ cvs login
$ mkdir ~/sandbox
$ mkdir ~/sandbox/myproject
$ cd ~/sandbox/myproject
$ echo "this is a sample file" > myfile
$ cvs import -m "description of myproject" myproject v1 r1
$ cd ..
$ rm -R myproject
$ cvs checkout myproject
$ cd myproject
$ echo "some changes to the file" >> myfile
$ cvs commit -m "Explain changes here" myfile