P4Sandbox: Private local branching, distributed development, and more

Posted on

Friday, August 26, 2011 - 07:12

Here at Perforce we’ve been following the discussion about distributed version control solutions with great interest. Although distributed version control has obvious appeal if you have a sporadic or low bandwidth connection to your SCM server, some of the workflow implications are equally compelling.

We still think that the centralized model has great merit, so we’ve decided to give you the best of both worlds. An upcoming release of Perforce will include our new private local branching and workflow solution. This solution will be much more than just a new client program to talk to a Perforce server. In fact, it could become a core part of the way you work with Perforce.

In this article I’ll introduce some of the key features and benefits of this solution.

The Architecture

Other resources will go into the technical details in much greater depth, but looking at the basic architecture of P4Sandbox will give you a better understanding of the features and benefits.

At its core, P4Sandbox puts a local Perforce server on your workstation.

Perforce Sandbox Architecture
High-level P4Sandbox architecture

P4Sandbox lets you select a branch of the central repository to keep on your local server, and handles all of the communication and synchronization between your local server and the central server. A P4Sandbox instance acts as a remote branch of the central server. You can use any of our normal Perforce clients, like P4V, the command line client, or P4Eclipse, to work on your P4Sandbox instance. P4Sandbox automatically pulls down changes from the central server to merge into your local server, and gives you the tools to push your changes up when ready.

Distributed Perforce

Of course, one of the key benefits of using P4Sandbox is that your team can continue working regardless of whether their connection to the central Perforce server is slow or non-existent. Your local P4Sandbox will have enough data to let you work independently of the connection to the central server. You’ll be able to use branching, shelving, and all the other advanced Perforce features. You only need to talk to the central server periodically, to pull and push changes.

Private Local Branching and Workflow

P4Sandbox will let you quickly and easily create new local branches, opening up a new horizon of productive workflows. You can use these local branches for fast task switching, experimentation, or a variety of other purposes. Your local branches are private and won’t interfere with other users; you have complete freedom to work as you see fit.

P4Sandbox Features
P4Sandbox Features

To each his own

The folks who design the branch model on the central server often have different goals than individual developers. The administrators and product leads who design a branch model are striving for clarity, ease of collaboration, and efficient release processes. That doesn’t always gel with developers who want the freedom to create task or experimental branches. With P4Sandbox, the developer can branch as much as she wants, and periodically push changes to the central server, with its more formally managed branching structure. If her local work isn’t exactly pristine, no one will care (or even know). From an administrator’s point of view, P4Sandbox is just about transparent, and the learning curve is shallow.

Speed

P4Sandbox offers several productivity features to keep you working quickly and efficiently. P4Sandbox uses just-in-time branching, which means that files are actually branched only as you start working on them. Just-in-time branching is one of the features that enables fast context switching: with P4Sandbox, you can very quickly switch between branches using in-place branching. Only the files that actually differ from branch to branch are updated in your workspace. And since you’re working against your local P4Sandbox most of the time, everything you do is fast. All the work you’re doing with P4Sandbox is work not done on the central server, which means it’ll be faster too.

Fast context switching

P4Sandbox offers the ability to rapidly switch tasks and branches, automatically saving work in the process. As you switch from branch to branch, any work in progress is automatically shelved on your P4Sandbox instance. That means that you can create local branches to work on different tasks, and quickly switch between them, with your work restored for you – even if you haven’t submitted it yet.

Tightly integrated

P4Sandbox is tightly integrated with the central Perforce server. New changes are regularly and automatically pulled from the central server, and local changes can be easily pushed up to the central repository. P4Sandbox shows that you shouldn’t have to sacrifice any of the advantages of a centralized server in order to use the local and distributed features.

A Unique Architecture

Perforce always tries to bring you the best parts of version control without any of the drawbacks: powerful but still fast, full featured but still flexible. P4Sandbox follows that principle, offering a unique combination of local and distributed features tightly integrated with a strong central server. Expect more details soon, but for now, suffice to say that we’re very excited about the possibilities P4Sandbox offers.

About the author

Randy DeFauw is Technical Marketing Manager at Perforce Software. Prior to joining Perforce, he was a certified Perforce consulting partner and trainer. He has extensive experience with Perforce configuration, administration, and integrations.

All posts by Randy DeFauw

Comments

Hi, P4Sandbox is out in

Hi, P4Sandbox is out in beta this fall. The current schedule says that the first beta rolls out in about a month (but schedules have been known to change). @starlatch: I think the unique part is blending centralized version control with some features from DVCS. (As another post noted, P4Sandbox is not a DVCS in and of itself.) Our Product Technology director is going to post more on this topic soon. Michael: P4Sandbox is strictly local and can only communicate with the central server.

When can we expect to see

When can we expect to see this?

If I have my workspace, which

If I have my workspace, which I can access from different machines (our typical case: Unix and Windows), am I limited to Perforce operations to one machine, or can I access that "local" server from another machine? IOW, can I treat p4sandbox server as a normal server, only with limited number of users? Can a small group (say, 3-4 people) share one p4sandbox? This is a very interesting feature, and we'd like to see how we can use it for our existing workflows. --Mike

[...] this presentation of

[...] this presentation of the new P4Sandbox : Private local branching, the author just seems to misundertand what DVCS is all about. The capacity to work offline and [...]

This all sounds great. When

This all sounds great. When is it scheduled to be released? How different is this from git or mercurial? A Unique Architecture? hardly. All I see is a feature-by-feature copy of git. It would be interesting to see it all work. Even the terms - push and pull are borrowed from git, and streams reminds me of ClearCase. Yeah. Thanks and I can't wait to get my hand on p4sandbox. We just need to figure out the epoch numbers ;-)

Free for up to 20 users, 20 workspaces, forever. Or unlimited users and 1,000 files.

Newsletter

Get articles by our experts, tips and tricks from our technical staff, and Perforce news—delivered monthly. Sign up now or view online.

Perforce Road Trip 2012