accurev add [ -c <comment> ] [ -d] [ -E
<value(s)> ] [ -x ] [ -R ] [ -s ]
[ -fi ] { -l
<list-file> | <element-list> }
The add command converts one or more existing files, directories, and/or links in a workspace to version-controlled
elements. The new elements are placed in the depot associated with your workspace. (They cannot be moved later to another depot.) Version 1 of each element is created in your workspace stream. The new elements will not appear in other streams or workspaces until you
promote them.
In the transaction recorded in the database for an add command, the AccuRev operation is listed as “create”, not “add”. Transactions are listed by the
hist command.
If a pre-create-trig trigger is defined for the depot, it fires before the
add command is executed. See the
mktrig reference page and
AccuRev Triggers on page 75 of the
AccuRev Administrator’s Guide.
By default, add guesses an element type for each file element it creates:
You can override add's element type determination with the
-E option, specifying
text,
binary, or a third element type,
ptext (a variant of
text, never assigned automatically). See below for a description of how AccuRev handles
ptext elements. You can also set the new element’s
exclusive file locking state:
serial (exclusive file locking enabled) or
parallel (exclusive file locking disabled).
By default, all files in a workspace are writable. You can edit any file at any time, and use keep to create new versions of them. But if you use the
-E serial option, the file becomes read-only after you
promote it to the backing stream. See
File Locking in Workspaces on page 5.
You can change both the element type and exclusive file locking state in subsequent keep -E commands. This change affects the newly created version and future versions only; it does not change the type of any existing version.
To see an element’s type, use the hist -fv or
stat -fk command. To see an element’s exclusive file locking state, use the
stat -fx command (see the
hierType attribute in the XML-format listing).
How AccuRev Handles File Elements of Different Types
AccuRev handles binary files very simply: when a new binary version is created (with
add or
keep), AccuRev simply copies the file from your workspace tree to the repository, creating a
storage file. When you retrieve a binary file from the repository (for example, with
co -v or
update), AccuRev simply copies the storage file to your workspace tree.
•
|
When a new version is created (add or keep), a new storage file is placed in the repository, with a single NL (or LF) character (hex character code x0A) at the end of each text line. This means that a version’s storage file may have different line terminators than the file you submitted to the add or keep command.
|
On the individual element level, you can override the manipulation of line terminators by specifying the “preserve text line terminators” element type, with the
-E ptext option. Files of this type are copied to and from the repository with no change, just like
binary files.
On the workspace level, you can force the use of a particular line terminator when text files are copied to the workspace, using the
-e option to
mkws or
chws. This applies to all elements of type
text, but not to elements of type
ptext.
How AccuRev Converts Existing Links to Link Elements
The add command converts existing link objects with
(external) status to AccuRev elements as follows:
•
|
The target is an (external) object in your workspace, and you specify the -s command-line option.
|
On a UNIX/Linux machine, if a file has any of its executable bits (user, group, other) set, then
add automatically sets all three bits on the kept version. Otherwise, all three bits are cleared on the kept version.
add can create directory elements as well as file elements. For each file it processes,
add automatically creates elements (if necessary) for the file’s directory, its parent directory, and so on up to the top level of the depot. If you want to turn an empty directory into an element, you can specify it as a command-line argument, or you can let
add -x find it automatically.
•
|
ACCUREV_IGNORE_ELEMS: Takes a SPACE-separated list of filename patterns. Causes add -x to ignore external files that match any of the patterns.
|
Deny access to other users. If your site makes use of element-level security (“EACLs”), this option allows you to add elements to the depot and immediately make them inaccessible to other users, while assigning FULL access to the user adding the element. After adding the element, the adding user can then set the EACLs appropriately.
Specify the element type: text (default) or
ptext or
binary; and/or specify the exclusive file locking state for this element:
serial or
parallel. To specify two (non-conflicting) values at once, separate them with a comma, but not a
SPACE:
Process the elements listed in <list-file>. This must be a text file, with one element name per line. Extra whitespace is not allowed; make sure there are no empty lines and no leading or trailing white space around the filenames. Wildcards are not expanded. There is no provision for comment lines in the file.
Recurse into each directory specified in <element-list>, and add all the external files in that directory subtree. You need not specify the
-x option. (Use “
.” to specify the current working directory.)
Create elements from all files in subdirectory widgets that are not already under version control: