I am writing a script to build all our projects on a Ubuntu build machine.
Each project is stored in Perforce and I am using p4 to perform the above.
The command I am using is:
p4 -u <MyUsername> -P <MyPassword> client MyWorkspace
This runs and loads vim which I then need to perform a :wq [Enter] to quit from.
Can I auto-save or avoid vim loading?
Description. A Perforce client workspace is a set of files on a user's machine that mirror a subset of the files in the depot. More precisely, it is a named mapping of depot files to workspace files.
Quick start with p4Open p4v (visual Perforce client). Right click on the project folder. Click "Open Terminal". Now you can use p4 in a preconfigured console, you don't need to setup workspace and server connection.
Your Perforce client spec defines your workspace location, the depot files you plan to work with, and their location in your workspace when you invoke Perforce commands. When you work with P4Web, all workspaces reside on the machine where P4Web is running.
The workspace root, also referred to as client root. If two or more client workspaces are located on one machine, they should not share a client root directory., specifies the location on your workstation under which Helix server stores copies of depot files.
For my builds I have a text file, which I have in perforce, containing my client. That way I know what the client looked like at that build (I don't use a spec depot).
So on unix machines:
$ cat client.txt | p4 client -i
or for windows:
type client.txt | p4 client -i
creates the client from the txt file in perforce. You can create the text by doing a p4 client -o <client_name> >client.txt
and change it from there.
You probably want to try p4 client -i
. From the help page:
The -i flag reads a client specification from the standard input. The user's editor is not invoked.
So you construct your client-spec in a script and pass it to p4 client -i
. Additionally, -t
could be helpful, too:
The -t flag constructs the client view by using the specified client's view and options as a template, instead of using the existing view or creating a new default view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With