Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce equivalent command to svn export

Tags:

svn

perforce

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?

like image 308
James Avatar asked Sep 18 '12 16:09

James


3 Answers

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.

like image 53
Bryan Pendleton Avatar answered Nov 18 '22 16:11

Bryan Pendleton


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.

like image 25
randy-wandisco Avatar answered Nov 18 '22 17:11

randy-wandisco


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.

like image 2
NickPoole Avatar answered Nov 18 '22 17:11

NickPoole