April 5, 2012

Portable Perforce: P4Sandbox on a USB stick


sandbox usb

Have you ever wished you could literally take your entire development workspace home with you, file history and all? Well, now you can, thanks to P4Sandbox.

P4Sandbox, which is part of the 2012.1 beta release of Perforce, gives you a private repository for local branches and development work.  That local repository is very portable. A regular P4Sandbox instance looks like this on disk:


The .p4sandbox directory contains your local Perforce repository data, while the client folder contains your workspace. You can easily zip up the top level folder (LOCAL-BRUNO-JAM-MAIN in this example), stick it on a USB stick, and take it home with you.  Not only do you have your workspace data, you also have your local branching information and version history.

Add in a portable text editor like gvim and you can work just about anywhere.

A Few Important Details

  • You'll need compatible P4Sandbox binaries everywhere you try to use P4Sandbox. Of course you can keep these on your USB stick as well.
  • Those P4Sandbox binaries must be in your PATH while working.
  • You should be working on machines with the same operating system and case sensitivity.
  • When you transfer your P4Sandbox instance to a new machine, run p4sandbox start in the top level folder.
  • Check your workspace root if your USB drive mounts as a different drive letter.
  • When you're done working and ready to eject your USB stick, run p4sandbox stop in the top level folder to make sure everything is shut down cleanly.
  • This workflow is best done through the command line at the moment.
  • Performance running from a USB stick may not be great, in which case you can copy the P4Sandbox folder to a regular disk before starting work.

See For Yourself

Grab the 2012.1 beta version of P4Sandbox and experience portable Perforce power!