Inside a Depot: Versions and Files

Let’s look inside a depot, to examine its architecture. This will help explain how AccuRev works, and will illuminate some of its most important, and unique, features.

Developers working on their files is the principal activity in any software development environment. With AccuRev, a developer’s files are stored in an ordinary directory structure, perhaps on the hard drive of a personal computer or laptop, perhaps in a designated area of a well-backed-up disk farm, etc. The only thing special about this developer’s work area is that AccuRev keeps track of its association with a particular depot. The work area is called a workspace, for more information, see AccuRev Workspaces and Reference Trees.

A developer can use any software tools to create and edit files, compile and build modules and applications. AccuRev doesn’t get involved in these operations at all, so there’s no performance penalty. Every so often, the developer tells AccuRev to save the current contents of a file (or a group of files) to the depot’s repository. This operation, called a keep, does two things:

This association is permanent: no matter what happens in the future, the contents of the file will always be available, through a reference to the version object. (For now, we’ll skip the details of how to specify a version, it’s just a bit more complicated than saying version 45 of file gizmo.c.)

In addition to providing access to the actual file contents, the version object stores additional information relating to the keep operation: the date and time of the operation, the user who performed the operation, a user-supplied comment, etc. This kind of information is often termed metadata.

In general, version objects are much smaller than the corresponding container files. (Developers often work with large source files. They also work with audio, image, and multimedia files, which are often even larger. As developers create more and more versions, the depot’s file storage area may grow to many gigabytes, requiring it to be split among multiple disk drives. But since the metadata stored for the depot contains the relatively small version objects, it grows much more slowly. Most likely, it will never outgrow its original storage location.