accurev

AccuRev, command-line, How to specify server address when login?


I'm using AccuRev5.7 command-line interface.

I know that "acclient.cnf" stores some server list.

How can I choose which server to login when running the "accurev login" command?
Can I pick one of the them, or, specify a new one, by command-line?


Solution

  • To log into another server via the CLI, use the "-H server:port" option for login.

    Example: accurev login -H servername:5050 username password

    Working with Multiple Repositories

    It’s possible to have multiple AccuRev repositories active in your organization, each managed by its own AccuRev server process. For most accurev CLI commands, you can specify the AccuRev server to target on the command line, using the –H option:

    accurev show -H pluto:5050 users

    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.

    Setting Up Workspaces on Multiple Repositories

    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-toserver 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:

    • If the current working directory is within one of the workspace-root-directory locations listed in the wspaces file, the CLI command is directed to the associated server listed on the same line of the file.

    • Otherwise (including the case in which no wspaces file exists), the CLI command is directed to first server listed in the machine’s acclient.cnf file. This is the default behavior that we’ve mentioned in the sections above.

    For example, here is a sample wspaces file recording workspaces associated with servers venus and pluto:

    gizmo_dvt_john /usr/john/gizmo_dvt venus 5050 frammis_2.3maint_john /usr/john/frammis_2.3_maint pluto 6678

    The format of the file is:

    • workspace name, which must not contain SPACE characters

    • full pathname of workspace’s root directory, which must match the pathname listed by the accurev show wspaces command, and must not contain SPACE characters. The pathname always uses forward slashes ( / ), not backslashes ( \ ), even on Windows machines.

    • server machine name (or IP address) AccuRev® CLI User’s Guide 5

    • IP port number on which AccuRev server program listens

    The last two fields must exactly match the server and port of an existing entry in the machine’s acclient.cnf file.

    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.