3. The File Browser : The Keep Command

The Keep Command
The Keep command creates a new version of one or more file elements. Both the contents of the version and its identity are stored permanently in the AccuRev repository. For each file you Keep:
AccuRev copies the contents of the file currently in your workspace tree to the associated depot in the repository.
AccuRev assigns a version-ID to the new version, consisting of the workspace's name and an integer. For example, the version-ID
talon_dvt_mary/17

... identifies the 17th version of the file element that was created in the workspace named talon_dvt_mary.
Invoking the Keep Command
In the Details pane of a File Browser that is open on a workspace, select one or more file elements. Then:
Click the Keep toolbar button, or
Right-click the selection and choose Keep from the context menu.
The Keep dialog appears, which you use to complete the command.
The Keep Dialog
The Keep dialog includes basic options (always visible) and advanced options (visibility controlled by a Basic/Advanced button).
Basic Options
Comment
You can enter a comment string in the text box. (AccuRev "seeds" the text box with your most recent Keep comment made during the current AccuRev GUI session.) 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 on the Keep command.
Advanced Options
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 on page 129.
Choose Lock Type
Choosing Enable File Locking places a lock on the element, to enforce serial development in sibling workspaces for that element. This ensures that users in sibling workspaces won't have to merge 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 The Locks Dialog Box on page 49.
Results of a Keep Operation -- the Details
The Keep command does the following:
Creates a new version
A new version object is created in the workspace stream. It has a unique version-ID, such as talon_dvt_mary/13 ("the 13th 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 Keep is termed a real version, because it represents an actual change to an element.
AccuRev allows you to invoke the Keep command on a file whose contents you haven't modified. So the new version might actually have the same contents as its predecessor.
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 to a container file in the depot. No AccuRev operation modifies or removes the container file (exception: archive command).
Sets the element status
The file element gets the status flag (kept) in your workspace. It also gets the (member) flag, indicating that the element is active in your workspace. (It's possible that the element already had one or both these status flags, from previous activity in your workspace.) If the element previously had (modified) status, this flag is removed.
Notes:
Content changes and namespace changes
The Keep command preserves content changes only, not namespace changes. Suppose you edit a file, so that it has (modified) status, then give it a new name with the Rename command. The new version that Rename creates does not record your content changes. The file will still have (modified) status until you preserve the contents changes with Keep.
"Undoing" a Keep operation
There is no true "undo" operation in AccuRev version control, since that would violate the TimeSafe principle. The Revert to Backed command provides a close approximation. If you want to "undo" some, but not all of several intermediate Keep's, perform a Revert to Backed command followed by a Send to Workspace of the intermediate version.

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com