An AccuRev workspace is a directory hierarchy on your hard disk, containing files that are being managed by AccuRev. You can create any number of workspaces — different ones for different development projects.
Note: Usually, you can think of a workspace as simply containing a collection of files. Sometimes, though, it helps to adopt AccuRev’s viewpoint: each file is a version-controlled
element; your workspace contains a copy of a certain
version of that element.
The AccuRev repository is organized into a set of storage depots. Each depot has a directory hierarchy for physical file storage (containing a set of version-controlled files and directories), and a separate schema in the database for metadata storage. Depots cannot overlap and cannot be contained within one another.
When you specify files to an accurev command, however, you usually don’t use full pathnames. In general, you
cd (“change directory”) to the workspace, then use relative pathnames to refer to files when issuing
accurev commands.
In addition, the accurev program recognizes a special kind of pathname, termed a
depot-relative pathname. This is the pathname to an element from the top-level directory of the depot — or equivalently, from the top-level directory of the workspace. Examples:
The special prefix — \.\ for Windows,
/./ for UNIX/Linux — that distinguishes a depot-relative pathname from an ordinary relative pathname. If your current directory is anywhere within a workspace, you can use a depot-relative pathname to refer to any element in the same workspace. If your current directory is not in the workspace, or you apply a command to a particular stream, using the
–s option, you must specify elements using their depot-relative pathnames.
Note that the –H option follows the command name — in this example,
show — not the program name,
accurev.
This mechanism bypasses the acclient.cnf file, though the file must still exist. It does
not override a specification in the
wspaces file, which is described below.
If the workspaces you’ve created on your client machine are not all associated with the same AccuRev server, then you might want to use a wspaces configuration file. This text file records the workspace-to-server association for each of your workspaces. Each user can have a
wspaces file. It must be located under the user’s home directory, within the
.accurev subdirectory.
The accurev program uses this file to decide which AccuRev server to use:
For example, here is a sample wspaces file recording workspaces associated with servers
venus and
pluto:
Note: If your site has a single AccuRev server (or if your workspaces are all associated with a single server), there is no need for a
wspaces file: the default behavior directs each CLI command to the server listed in your machine’s
acclient.cnf file.
Exclusive file locking (serial-development mode) can be implemented at the depot level, the workspace level, or the element level (
keep –E,
add –E). If exclusive file locking applies to an element:
Note: In this context, workspaces are considered siblings if they promote to the same stream. If the stream hierarchy includes pass-through streams, workspaces can be siblings even if they have different parents.
In an anchor-required workspace,
all elements are maintained in a read-only state when you are not actively working on them. Using such a workspace is similar to working with exclusive file locking, except that you are not constrained by elements’ activity in sibling workspaces: