I am trying to modify my build script to work with a new project that is based in perforce. The script creates a tag and then wants to check out the tag into a temp directory. In subversion I would use in the svn export
command. In git I would git archive | tar -x
. Is there an equivalent command in p4
? Or am I required to set up a temporary client space, sync, build, and then delete the client space?
creating and sync'ing a client is what I've always done. I don't know why you'd need to build the client, though; just create it, sync it, tar the client-side files, sync it to #0 to clean up the mess, and delete the client. That seems like a straightforward approach.
Theoretically you could use p4 print
to obtain file content without using a workspace. However I think you'll find that using a workspace is easier and more efficient.
Sven Erik Knop wrote submitted a script to he Perforce Public depot that uses p4 print (via P4Python) to create a zip file containing a file tree. You can find it here:
https://swarm.workshop.perforce.com/guest/sven_erik_knop/P4Pythonlib/scripts/PrintZip.py
Update: Swarm has a download button that will zip up a directory in a similar manner.
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