Working with an P4 environment has its quirks,
such as not always being able to submit,
hence having unrelated changes accumulating in the same file.
In such cases, you can either submit the whole bunch, hoping you didn’t break anything on the way and letting any poor integrator lost in the rain, or spending even more time trying to untangle everything in order to make small submits again (good luck with this if you did NOT start out with making many shelved changes on the way).
To remedy to this pain, Perforce created the so called P4Sandbox, which functions as a local (single workspace) replication server to which you submit your changes to, and later sync with the central server. While working, you can still get the latest updates from the central server by syncing (and resolving possible conflicts along the way).
Setting up a P4Sandbox is pretty easy,
since there’s an assistant.
You will need to create a client mapping for the files you want to work on,
and get those replicated into the local copy.
From there, you create another workspace, this time using the P4Sandbox as server, and start working.
+ Distributed: Able to work even when the central server is not available.
+ Lockless: You can still submit even if the files are locked on the central server.
+ Locality: It’s faster than using the central server.
– Disk space usage: 2 workspaces + the replicated data: the whole thing will take quite some disk space. Of course, this works great if it’s only source files (or small image data), but once you have a lot of game assets in it, be prepared to see your free disk space fade away quite quickly.
– Submit comments: comments done to changes in the P4Sandbox went lost while syncing them with the central P4Server.
– Shelves: shelving did not work when I used it. Might have been a bug, though.
If you’re like me and annoyed by the limits imposed on you by a central P4 server, I can only urge to try it out for yourself.