pythonlinuxcommand-lineperforceperforce-client-spec

P4 Command line instructions for creating workspace from a template and make additional changes to client spec


I am looking to create a P4 workspace ST_TEST_BUILD1 from a template workspace MC_CRM_BUILD_1XAB.

I want to make changes to the cspec in my new workspace. In addition to the cspec mapping from template i wish to add the following.

How can i do this using P4 command line on linux? My current OS is Ubuntu. If i wish to automate this should i use a shell script or python or perl?


Solution

  • The P4Perl and P4Python scripting APIs have interfaces that let you programmatically manipulate client specs; the general idea is that you'll run client -o to get the client spec, add some stuff to the View field, and save the formatted result with client -i. You can also do this in the shell pretty easily:

    p4 --field "View+=//source/map/data/... //ST_TEST_BUILD1/map/data/..." --field "View+=//source/audio/data/... //ST_TEST_BUILD1/audio/data/..." --field "View+=//source/video/data/... //ST_TEST_BUILD1/video/data/..." client -t MC_CRM_BUILD_1XAB -o ST_TEST_BUILD1 | p4 client -i