Installing AccuRev on a machine creates a client configuration file, acclient.cnf, in the AccuRev executables directory. (That’s subdirectory
bin of the location designated as the “Install Folder” or “Install Directory” during installation.) The configuration file specifies the network location of the IP port on which an instance of the AccuRev Server is listening for client requests. For example:
In what order should the servers be listed? For users of the AccuRev CLI (accurev), the order is important: by default, each AccuRev CLI command is directed to the server listed on the
first line of the client configuration file. This implies that if you want to change the “active server” in the CLI, you need to rearrange the lines in your machine’s
acclient.cnf file. This is quite doable, but cumbersome; the sections below describe a better way for CLI users to work with multiple AccuRev servers. For users of the AccuRev GUI, it doesn’t matter. The GUI’s
Tools > Login command revises the
acclient.cnf file, moving the line for the new active server to the beginning of the file.
Tip: The
ACCUREV_SERVER environment variable influences which AccuRev Server the AccuRev GUI interacts with at startup time. See
ENV_VARS of the
AccuRev CLI User’s Guide for more information.
Each AccuRev workspace is associated with a particular AccuRev server: the workspace is attached to a particular stream, which belongs to a particular depot, which is managed by a particular server. When you execute a
mkws command to create a new workspace, the command is directed to the server that is listed first in the machine’s
acclient.cnf file. (You must use the
–s option to specify a backing stream for the new workspace; this stream must belong to one of the depots managed by that particular server.) To access multiple workspaces on multiple servers, create a workspace configuration file as described in
Working with Multiple Repositories of the
CLI User’s Guide.
Note: It is more precise to describe the workspace’s association as being with a particular AccuRev
repository, rather than with a particular AccuRev
server. This workspace-to-repository association is permanent: AccuRev has no concept of associating an existing workspace with a different repository (or even with a different depot in the same repository). On the other hand, many of the details can change: you can rename a workspace; you can move a workspace to a different location in the file system or to a different machine; you can move a repository to a different machine.
For most commands in the accurev CLI program, you can specify the AccuRev server/repository to target on the command line, using the
–H option:
The –H option follows the command name — in this example,
show —
not the program name,
accurev. The hostname/port-number argument to this option has the same form as in the
acclient.cnf file.
This mechanism bypasses the acclient.cnf file, though the file must still exist. It does
not override a specification in the
wspaces file.