The Add to Depot command places the selected files and/or directories under version control The discipline of keeping track of the changes made over time to a file or directory.. For each file/directory, this includes:
Creating an element A file or directory that is under AccuRev version control. See version. in the depot.
Creating the version A particular revision of an element, reflecting a content change (files only) or a namespace change (files and directories). All versions are originally created in workspaces, and can subsequently be promoted to dynamic streams. The original (workspace) version is termed a 'real version'. Each promotion to a dynamic stream creates a 'virtual version', which serves as an alias for (pointer to) the original real version. 1 of the element in your workspace stream The private stream that is built into a workspace. All new versions of elements are originally created in workspaces; AccuRev records these versions in workspace streams..
The status of each file/directory changes from (external) to (kept).
In the Details pane of a File Browser that is open on a workspace, select one or more files and/or directories. All the selected objects must currently have (external) status. Then:
Click the toolbar button, or
Right-click the selection and choose Add to Depot from the context menu.
The Add to Depot dialog appears, which you use to complete the command.
The Add to Depot dialog includes basic options (always visible) and advanced options (visibility controlled by a Basic/Advanced button).
Comment
You can enter a comment string in the text box. (AccuRev "seeds" the text box with your most recent Add to Depot comment.) The comment string becomes a permanent annotation to the version you're creating.
AccuRev itself does not require a comment, but your organization can establish such a requirement by putting a trigger The AccuRev facility that enables user-defined procedures (trigger scripts) to be performed automatically before or after certain operations take place. on the Add to Depot command.
Choose File Type
By default, AccuRev determines the element type for the newly created version automatically (text or binary). You can override the default by specifying either of these types or ptext (a variant of text). See AccuRev Element Types.
Choosing Enable File Locking places a lock A control on the file element, requiring (1) users must Anchor the file before editing it, and (2) if a user has Anchor'ed the file, users in sibling workspaces cannot Anchor or edit the file. on the element, to enforce serial development The practice of ensuring that multiple users do not work concurrently on the same version-controlled file. See parallel development. in sibling workspaces Two or more workspaces or streams that have the same parent stream. for that element. This ensures that users in sibling workspaces won't have to merge An operation that combines the contents of two versions (contributors) of the same element. To merge the contents of text files, AccuRev uses a '3-way merge' algorithm: it compares the two files line-by-line with a third file, the version that is the closest common ancestor of the other two. Merging of namespace changes also takes into account the closest common ancestor. their work on this element. The lock remains on the element until you (or someone else) changes this value to Disable File Locking in a subsequent Keep command. See File Locks.
Add links as symbolic links
By default, a symbolic link (UNIX/Linux) or junction point (Windows) is added to the depot as an AccuRev element link, not as an AccuRev symbolic link. Use this checkbox to cause such objects to be converted to AccuRev symbolic links.
The Add to Depot command does the following:
Creates a new element in the depot
A new element A file or directory that is under AccuRev version control. See version. object is created in the depot The portion of the AccuRev repository that stores the entire history of a particular directory tree. See element, version. to which your workspace A location in which one or more users perform their work, using files under version control. Each workspace consists of a workspace stream in the repository, and a workspace tree in the user’s disk storage. belongs. AccuRev will track all future changes to this element -- both content changes A change to the contents of a file element, recorded in a new version created with the Keep command. For a link element, a change to the target pathname is a content change. See namespace change. and namespace changes A change to the pathname of a file or directory element: either renaming the element in place or moving the element to a different location in the depot’s directory hierarchy..
Creates the first version of the element
A new version object is created in the workspace stream The private stream that is built into a workspace. All new versions of elements are originally created in workspaces; AccuRev records these versions in workspace streams.. It has a unique version-ID The unique identifier for a version, consisting of two parts: (1) the name or number of the workspace or stream in which the version was created; (2) an integer. Examples: talon_dvt_mary/14, 245\19., such as talon_dvt_mary/1 ("the first version of this element created in workspace talon_dvt_mary"). A version object is immutable, and cannot be removed from the repository. The version created by Add to Depot is termed a real version A version of an element, created in some user’s workspace, recording a change to the contents and/or pathname of the element. See version, virtual version., because it represents an actual change to an element.
Preserves the contents of the new version
The contents of the new version are preserved permanently in the repository. AccuRev copies the file in your workspace tree The ordinary directory tree, located in the user’s disk storage, in which the user performs development tasks and executes AccuRev commands. to a container file The ordinary file, located in the file storage area of the AccuRev repository, that contains the permanent copy of a version created in a workspace with the keep command. in the depot. No AccuRev operation modifies or removes the container file (exception: archive An operation that transfers the storage files for one or more versions from a depot’s file storage area to its gateway area. After the archived storage files are copied to off-line storage, the disk storage within the gateway area can be reclaimed. command).
The file element gets the status flag (kept) in your workspace. It also gets the (member) flag, indicating that the element is active An element is said to be active in a workspace or stream if a new version of the element has been created there, and that version has not been either (1) promoted to the parent stream or (2) purged from the workspace or stream. See default group, backed, passive. in your workspace.
Notes (click to view):
"Undoing" an Add to Depot operation
There is no true "undo" operation in AccuRev version control, since that would violate the TimeSafe The aspect of AccuRev’s architecture that guarantees the reproducibility of any previous configuration of a stream, a depot, or the entire repository. principle. But invoking the Revert to Backed command on a file that you just added to the depot (and haven't Promote'd) is a very close approximation. The newly created element disappears from your workspace; you can retrieve its initial version only by using the unique element-ID The unique, immutable integer identifier by which AccuRev tracks the changes to a particular file element or directory element. An element's name or pathname can change, but its element-ID never changes.. (CLI commands hist -fv and cat -e)