Using config files
Config files are text files containing settings that are in effect for files in and below the directory where the config file resides. Config files are useful if you have multiple client workspaces on the same computer. By specifying the settings in config files, you avoid the inconvenience of changing system settings every time you want to work with a different workspace.
To use config files, you define the P4CONFIG
environment
variable, specifying a file name (for example, .p4config
).
When you issue a command,
Helix Core Server
searches the current working directory and its parent directories for the
specified file and uses the settings it contains (unless the settings are
overridden by command-line options).
Each setting in the file must be specified on its own line, using the following format:
setting
=value
Make sure there are no spaces. For example,
will not work.setting
= value
The following settings can be specified in a config file:
Setting | Description |
---|---|
|
Character set used for translation of Unicode files. |
|
Non-UTF-16 or UTF-32 character set used by Command-Line Client
when |
|
Name of the current client workspace. |
|
The name and location of the diff program used by |
|
The editor invoked by those Helix Core Server commands that use forms. |
|
Hostname of the client computer. Only useful if the
|
|
A list of files to ignore when using the |
|
This environment variable is reserved for system integrators. |
|
The name and location of the third-party merge program to be
used by |
|
Supplies the current Helix Core Server user’s password for any Helix Core Server command. |
|
The protocol, host and port number of the Helix Core Server (including proxies or brokers) with which to communicate. |
|
The location of a file of known (trusted) Helix Core Server. You manage the contents of this file with the
|
|
Current Helix Core Server user name. |
For details about these settings, refer to the Helix Core Command-Line (P4) Reference.
Example Using config files to handle switching between two workspaces
Ona switches between two workspaces on the same computer. The first
workspace is ona-ash
. It has a client root of
/tmp/user/ona
and connects to the Helix Core Server using SSL at ssl:ida:1818
. The second workspace is
called ona-agave
. Its client root is
/home/ona/p4-ona
, and it uses a plaintext connection to a Helix Core Server at tcp:warhol:1666
.
Ona sets the P4CONFIG
environment variable to
.p4settings
. She creates a file called
.p4settings
in /tmp/user/ona
containing the
following text:
P4PORT=ssl:ida:1818 P4CLIENT=ona-ash
She creates a second .p4settings
file in
/home/ona/p4-ona
. It contains the following text:
P4PORT=tcp:warhol:1666 P4CLIENT=ona-agave
Any work she does on files under /tmp/user/ona
is managed
by the Helix Core Server at ssl:ida:1818
and work she does on files under
/home/ona/p4-ona
is managed by the Helix Core Server at tcp:warhol:1666
.