Promotion: Real Versions and Virtual Versions

Software development is much more than just creating and modifying files. A typical development project involves many phases, possibly including initial development, integration of work done independently, internal system testing, external testing, and final production. AccuRev uses a promotion model to manage files in these multiple development phases. Files progress through the phases, one by one: when a set of files pass the tests (if any) mandated for a particular phase, a user working on that phase promotes them to the next phase.

AccuRev keeps track of each promotion by creating a new version of each promoted file. But promotion doesn’t change the contents of a file, it only changes the file’s approval level. Thus, each new version object created by promotion is merely an additional reference to (or alias for) the same file in the depot’s file storage area.

AccuRev distinguishes between the original version, created by a keep operation, and all the additional versions created by a promote operation:

Real version
Created by operations like keep, add, merge, rename, etc. The operation creates a new version object in the metadata stored for the depot and places a new file in the depot’s file storage area.
Virtual version
Created by a promote. It creates a new version object in the metadata stored for the depot, which provides an additional reference to an existing file in the file storage area. Conversely, a demote operation removes a virtual version.