Perforce Public Knowledge Base - Using Multiple Workspaces with P4EXP
Reset Search
 

 

Article

Using Multiple Workspaces with P4EXP

« Go Back

Information

 
Problem
I need to use P4EXP with multiple workspaces.

Solution

Like other Perforce clients, P4EXP takes its configuration parameters from, in order of precedence, the following:

  1. The configuration file, if any
  2. Environment settings (the registry)
  3. System defaults (for example, P4CLIENT defaults to the system's hostname)

As (2) and (3) only allow for setting the variables for a single workspace, the solution lies with using option (1), the configuration file.  You can set up a specific configuration file for each workspace that defines how P4EXP (or any Perforce client) acts for that given workspace.

Before you set up the configuration files, you will need to tell the Perforce clients where to look for the configuration file. This is done by setting the P4CONFIG registry setting. Open a command-line window and then issue the following command:

p4 set P4CONFIG=p4config.txt


After this is set, Perforce clients will look for a file named p4config.txt when unsure of what settings to apply.

Now, for each workspace that you want to manage with P4EXP, create a file named p4config.txt in the workspace root. If your workspace root (check with 'p4 client -o <workspace>') is C:\Users\Myname\Project\ProjectAlice, then you would create the p4config.txt file here - C:\Users\Myname\Project\ProjectAlice\p4config.txt

Inside this file, place the following lines of text:

P4PORT=<server>:<port>
P4USER=<username>
P4CLIENT=<workspace>


Where <server>, <port>, <username>, and <workspace> are replaced with the parameters specific to your needs.

After this is set, whenever you manipulate a file in that workspace using P4EXP, the right variables are used.
 

Note: Often times, users wish to prevent p4config.txt from being included in any client operations and from being versioned by Perforce. In a "classic" (non-Streams) environment, this can be accomplished via exclusionary mappings, by adding the following line to your workspace view:

-//<depot_name_1>/.../p4config.txt  //<workspace_name>/<depot_name_1>/.../p4config.txt
-//<depot_name_2>/.../p4config.txt  //<workspace_name>/<depot_name_2>/.../p4config.txt


In a Streams environment, you can use the p4 stream command to add p4config.txt to your stream specification's 'Ignored:' field.

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255