Reputation: 1
I'm working on a virtual hard disk in order to imitate a production setup and each workspaces that I'm using correspond to one folder which I mount into the virtual hard disk.
That's why I would like to have a script which change automatically the folder regarding of the choosen workspace.
Does someone have any ideas how to do that ?
Thanks in advance.
Colin
Upvotes: 0
Views: 129
Reputation: 71517
You probably want to use P4CONFIG
.
The idea of P4CONFIG in a nutshell is that it allows you to associate each local folder with a client configuration (i.e. P4CLIENT
, and potentially P4USER
, P4PORT
, etc). Issuing a p4
command from a given folder automatically switches your configuration to that provided by the P4CONFIG
file in (or above) that folder.
This is the standard way of working with multiple workspaces (or servers) on one client machine without having to continually update your settings.
In the context of a virtual drive that you're remounting, you'd put the P4CONFIG
file in the root of the target folder, and then when you remount (e.g. via subst
), the appropriate config file appears in the root of the mounted folder, whereupon all your p4
commands recognize that the workspace has changed.
Upvotes: 1