14.01.2013 Views

AccuRev CLI User's Guide

AccuRev CLI User's Guide

AccuRev CLI User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

add add a new element to a depot<br />

Usage<br />

accurev add [ -c ] [ -E ] [ -x ] [ -R ] [ -s ]<br />

[ -fi ] { -l | }<br />

Description<br />

The add command converts one or more existing files, directories, and/or links in a workspace to<br />

version-controlled elements. The new elements are placed in the depot associated with your<br />

workspace. (They cannot be moved later to another depot.) Version 1 of each element is created<br />

in your workspace stream. The new elements will not appear in other streams or workspaces until<br />

you promote them.<br />

In the transaction recorded in the depot’s database for an add command, the <strong>AccuRev</strong> operation is<br />

listed as “create”, not “add”. Transactions are listed by the hist command.<br />

If a pre-create-trig trigger is defined for the depot, it fires before the add command is executed.<br />

See the mktrig reference page and <strong>AccuRev</strong> Triggers on page 53 of the <strong>AccuRev</strong> Administrator’s<br />

<strong>Guide</strong>.<br />

Controlling the Element Type and Exclusive File Locking State<br />

By default, add guesses an element type for each file element it creates:<br />

• If the file is strict ASCII, it sets the element type to text.<br />

• Otherwise, it sets the element type to binary.<br />

Note: Unicode files are considered to be binary, not text.<br />

You can override add's element type determination with the –E option, specifying text, binary,<br />

or a third element type, ptext (a variant of text, never assigned automatically). See below for a<br />

description of how <strong>AccuRev</strong> handles ptext elements. You can also set the new element’s<br />

exclusive file locking state: serial (exclusive file locking enabled) or parallel (exclusive file<br />

locking disabled).<br />

By default, all files in a workspace are writable. You can edit any file at any time, and use keep to<br />

create new versions of them. But if you use the –E serial option, the file becomes read-only after<br />

you promote it to the backing stream. See Exclusive File Locking and Anchor-Required<br />

Workspaces on page 4.<br />

You can change both the element type and exclusive file locking state in subsequent keep –E<br />

commands. This change affects the newly created version and future versions only; it does not<br />

change the type of any existing version.<br />

To see an element’s type, use the hist –fv or stat –fk command. To see an element’s exclusive file<br />

locking state, use the stat –fx command (“hierType” attribute in the XML-format listing).<br />

<strong>AccuRev</strong> <strong>CLI</strong> User’s <strong>Guide</strong> 40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!