[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To get some information regarding CVS

From: Spiro Trikaliotis
Subject: Re: To get some information regarding CVS
Date: Sat, 24 May 2008 14:34:38 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)


* On Sat, May 24, 2008 at 12:59:14PM +1000 Arthur Barrett wrote:
>    You don't need to know how the information is stored - just use the
>    commands provided and CVS server manages all the rest for you.

That is true - in general. However, there might be some legitimate
reason one wants to know how they are stored, anyway.

CVS internally uses the RCS file format. (This is only true for "real"
CVS; CVSNT, another variant of CVS, does not stick to this format!) RCS
could only handle one file at a time; CVS added the ability to handle
complete directories instead.

Note, however, that CVS has done some (rather small) changes to the
format, especially when it comes to branches. I do not know where these
changes are documented; but when you work with CVS, you will find out
about them on your own rather quickly. ;)

The RCS format can be found at two places: On a Unix machine, you can
have a look into rcsfile(5) - or search on the web for that information
(for example, it can be found currently at
Additionally, the following article describes everything a litle bit
more in detail:

  Walter F. Tichy, RCS—A System for Version Control, Software—Practice &
  Experience 15, 7 (July 1985), 637-654.

For me, it was a very good read when I started working with RCS (around
1991, I believe). From there, it was rather easy (for me) to switch over
to CVS.

What are the changes of CVS? CVS uses another technique for branches.
With RCS, when you create a branch, it is imnmediately created for the
file. That may be logical, as you are operating on each file separately.

For CVS, this is not true. In most cases, you generate a branch for the
whole directory (and its subdirectories). Thus, when you branch with
CVS, it starts by creating a tag only for the branch. Its is only when
you commit a file to that specific branch when the branch is actually
created in the RCS file (,v) on the repository, and only for this one

What do I mean?

Take, for example, that I branch a file from revision 1.3 in RCS. In
this case, RCS generates a branch revision 1.3.1. If I check in some
changes there, it gets the revision; the next changes gets, and so on.

When I do the same with CVS, it is different. When I branch from 1.3, I
special tag is created with the revision (Note the extra ".0"
in that revision, which is used to distinguish this special CVS tag from
other RCS-style tags!) That is all; no (RCS) branch is actually created.
If I never check in a modification on this file to this branch, this was

Now, if I check in a modification to this branch, then the RCS branch
1.3.2 is created, and my first modification gets the revision number

Note that there are some subtleties in this process. I do not know of an
official documentation (other than the CVS sources, that is), but you
will find out many of them if you do your own tests. Note that a special
CVS tag for a CVS branch has always an even number of numbers (x.y.0.z,
or x.y.w.v.0.z, or ...), and the last number is always even (that is, z
is divisible by two) - (BTW: Why is this so?)

Despite of these rather small changes, the article of Walter F. Tichy
from above and the rcsfile(5) documentation will tell you almost
everything you asked in your first mail. If you have more specific
questions, just ask.

>    If you are wanting to write some sort of tool that extracts
>    information from a CVS repository - use the CVS client to do that for
>    you with commands like 'cvs log' and 'cvs export' - never ever ever
>    try and read a repository directly - it's the job of the CVS server to
>    do that.

Well, although I do not advocate reading and writing the ,v file
directly, this is exactly the reason why CVS is very reluctant when it
comes to changing the internal format. There are many tools out that use
the RCS tools (or do it directly) in order to read the ,v files.

For CVSNT, you are certainly right, as the format is no RCS format

BTW: Is there any documentation of the format used by CVSNT? As I see,
cvs2svn still has problems when being used on CVSNT repositories.
Wouldn't it be a good idea to give the developers a good documentation
so they can fix these problems (if they want, that is)?

Best regards,

Spiro R. Trikaliotis                               

reply via email to

[Prev in Thread] Current Thread [Next in Thread]