Create Client Workspace using Perforce command-line on Ubuntu

Viewed 37232

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?

9 Answers

Simply run the command 'p4 client' after 'p4 login'. It will ask for all the details after running the command. you just fill those details as per your requirement.

Mainly, You need to only focus on two parameters in the temp file. As soon as you save the file, the client would be created.

Root: This is the local repository path. for example,
Root: /User/codebase/code

View: stream you want to map to remote depot from your client. for example,
View: //exp/main/... //expbuild_centos/...

[root@no1011142063123 ~]# p4 client "expbuild_centos"
Client expbuild_centos saved.
[root@no1011142036123 ~]#  

If you would like to keep the entire process inside perforce make a template workspace / client called client_template and pipe it in

p4 client -o -t client_template new_client|p4 client -i
Related