27.01.2015 Views

CLI User's Guide - AccuRev

CLI User's Guide - AccuRev

CLI User's Guide - AccuRev

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Placing Files Under Version Control<br />

The files in a workspace are not automatically version-controlled. After all, there are many files<br />

that you don’t want to version-control: text-editor backup files, intermediate files and log files<br />

produced during software builds, files you may have downloaded from the Internet, etc. A file<br />

that’s in a workspace but is not under version control is said to have external status.<br />

To place one or more external files under version control, use the add command:<br />

accurev add Red.java White.java Blue.java<br />

(The files must already exist; add won’t create an empty file for you.)<br />

You can have add search for all external files — throughout the entire workspace — and convert<br />

them to elements:<br />

accurev add -x<br />

This also places the directories containing those files under version control (if they aren’t<br />

already). Using add –x makes it very easy to convert an existing directory tree into a workspace<br />

(see Creating a Workspace on page 19), then place all the files in that directory tree under version<br />

control.<br />

Editing Files in a Workspace<br />

By default, the files in a workspace are always writable. You can edit the files at any time, using a<br />

text editor, an IDE, or any other application.<br />

If you’re in a workspace in which you must “check out” a file before editing it (see File Locking<br />

in Workspaces on page 5), version-controlled files are maintained in a read-only state until you<br />

invoke the co or anchor command on them.<br />

Checkpointing — Saving Private Versions<br />

At any time, you can keep the changes you’ve made in one or more files. The keep command<br />

creates an official new version of a file. This includes making a permanent copy in the depot of<br />

the file’s current contents. At any point in the future, you can revert to this version. This “save it<br />

just in case” procedure is commonly called checkpointing.<br />

But keep does not make the new version public — it remains private to your workspace. Nobody<br />

else will see your changes yet. You can keep as many private versions (i.e. checkpoint the file as<br />

many times) as you want, without affecting or disrupting other people's work.<br />

Here’s an example of the simplest form of the keep command:<br />

accurev keep testrun.pl<br />

You’ll be prompted to enter a comment string, which can span multiple lines. It might be easier to<br />

include short comments in the command itself:<br />

accurev keep -c "shorten timeout" testrun.pl<br />

<strong>AccuRev</strong>® <strong>CLI</strong> User’s <strong>Guide</strong> 21

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

Saved successfully!

Ooh no, something went wrong!