accurev mkws -w <workspace-name> -b
<backing-stream> -l
<location>
[ -k
<kind> ] [ -e
<eol-type> ] [ -i ]
The mkws command creates a
workspace, in which you can work with the version-controlled files (
elements) in a particular AccuRev depot. See
Entity Names for information on naming workspaces.
•
|
Workspace tree: a directory tree located in your machine’s disk storage, or in remote storage accessed through a network file system. The directory tree is simply a collection of files that is (loosely speaking) your copy of the depot.
|
•
|
Workspace stream: a stream in the designated depot, dedicated to the workspace. All changes you make in the workspace are initially recorded in this “private” stream.
|
You use accurev commands to move development data between the workspace tree (temporary private storage) and the depot (permanent public storage):
•
|
The pop (“populate”) and update commands copy files from the depot to the workspace tree. Each file is a copy of a particular version of some element.
|
•
|
The keep command copies files from the workspace tree to the depot. Each copied file becomes a new version of the element, in the workspace stream. The creation of the new version is recorded as a transaction in the database.
|
When you create a workspace, you assign it a simple workspace name. The associated workspace stream is assigned the same name, because it is dedicated to the workspace. This name must be unique across all depots;
mkws helps you out in this regard by automatically appending your
principal-name to the name you specify with the
-w option.
Each workspace has an update level, which indicates how up-to-date the workspace’s files are. For example, an update level of 3475 indicates that your workspace has incorporated (through the
update command) changes recorded in transactions up to and including transaction #3475.
When you create a workspace, mkws does not copy any files into the workspace tree. The workspace’s update level is initially set to transaction #0. Since no version of any element existed at this update level (before any transactions were recorded in this depot), there is no data to be copied into the workspace. The
-i option (see below) provides a variant of this workspace initialization scheme.
Note: When you create a new workspace in the AccuRev GUI, the update level is set to the most recent transaction, and files
are copied into the workspace tree.
To fill a new workspace with files, enter an update command. This creates a directory hierarchy in the workspace tree and sets the update level to the depot’s most recent transaction.
Note: The workspace tree must be fully contained within a single physical file system, whether local or remote. Example: you create a workspace at location
/opt/workspaces/derek; an error occurs if a remote file system is mounted at
/opt/workspaces/derek/src.
By default, mkws creates a standard workspace, which has the following characteristics:
You can override this characteristic with the -e option:
-eu forces the workspace’s version-controlled text files to use the UNIX/Linux line terminator;
-ew forces the workspace’s version-controlled text files to use the Windows line terminator.
If you create a workspace by mistake, you can make it invisible with the rmws command. This does not actually delete the workspace — that would violate AccuRev’s
TimeSafe property. Once created, a workspace persists in the workspace registry forever.
rmws merely hides the workspace, and attempts to create another workspace with the same name will fail.
The location you specify with the -l option can be an existing directory. This has the effect of turning the entire directory tree at that location into a new workspace. All the files and subdirectories in the directory tree start out as
external objects. To convert them all to version-controlled file and directory elements, execute the command
accurev add -x from anywhere within the newly created workspace.
•
|
-kd: (“default”) Create a workspace that doesn’t have any of the features enabled by the other -k options.
|
•
|
-ka: Create an anchor-required workspace, in which you must use the anchor or co command on a file before modifying it.
|
The -ke and
-ka options are mutually exclusive.
See the incl and
excl reference pages for a way to configure a workspace with just the files you need. Also, see the
-i option below.
Specify the line terminator to be used when an AccuRev command (e.g. update,
co) copies a version of a text file from depot storage to the workspace. (In depot storage, all text files are stored with the AccuRev-standard line terminator,
NL.) The <
eol-type> can be
d (default: use the standard line terminator for the client machine’s operating system),
u (use the UNIX/Linux line terminator,
NL), or
w (use the Windows line terminator,
CR-NL).
Create a workspace for bugfixes in /home/jsmith/ws, backed by the
gizmo1.1 stream:
This creates a workspace and a stream named gizmo_bugfix_john_smith. (if your principal name is
john_smith).