[Top][All Lists]

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

Code-wise, How Does CVS Do Versioning?

From: dave
Subject: Code-wise, How Does CVS Do Versioning?
Date: 21 Oct 2005 09:09:43 -0700
User-agent: G2/0.2

This is more or less a question about the workings of the CVS archive.
I am assuming a tag/label is a set of file pointers.  So, when you ask
for all the files withing a certain tag/label, it just traverses these
pointers.  If this is not how CVS works internally, please correct me
and inform me how it uses the tag/label meta-data to reconstruct a view
from a label/tag.  But, my question is still assuming the file pointer

Suppose you have a file f with versions f_0, f_1, f_2, . . . , f_n.
Where f_0 was the first version of the file and f_n is the current
version.  There are two naive ways of doing archiving:

1) Strict archive.  At time t=n+1, the archive contains f_0, f_1, f_2,
. . . , f_n and the current version is f_(n+1).  i.e. the archive is
strictly an archive and only contains the older versions.

2) Current archive.  At time t=n+1, the archive contains f_0, f_1, . .
. , f_n, f_(n+1).  i.e. the archive contains every version of the file
including the current version.

But, why would you include a copy of the current version?  Good
question, my dear reader.

Consider when a tag/label is made on the current version of the file.
Case 2 is easy.  It will simply point to the file f_(n+1) in the
archive which will (hopefully) never change.  However, in case 1, the
tag will point to f_(n+1) which is the working copy.  If the user
changes this, then f_(n+1) will move to the archive.  This file, in
turn, must get each label it is associated with and tell that label/tag
to point to the file f_(n+1) in the archive.

Of course, it could always do a hybrid (i.e. do case 1, but if tagging
a current version, copy to archive, point to archive).  However, the
provided hybrid would have to know not to duplicate the current version
in the archive (i.e. f_n is working version, it is tagged and copied to
archive version f_n, then working copy f_n is modified to f_(n+1) but
f_n should not be copied to archive).

So, if you have read through this all and understand it all, please
provide your comments whether they be CVS based or personal opinions.
I am working on a system which needs to do versioning and assume the
CVS community has thought much longer on this problem than I.


reply via email to

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