November 11, 2011

Working Light with Streams

Flexible Workflows
Streams
Traceability

Streams introduces a shift in the way workspaces are configured, with each workspace dedicated to a single stream and containing a centrally-generated view. In the 2011.1 P4V release, we've designed the ability for users to work with streams in 3 different modes:

  • Mode 1: Use a different workspace for each stream (the default)
  • Mode 2: Use the same workspace and switch it between streams (this mode is always used by Sandbox, now in Beta)
  • Mode 3: Use multiple workspaces per stream, each dedicated to a different activity (a variation of Mode 1)

Mode 1: Use a different workspace for each stream

Workspaces Streams Mode 1
Note: workspaces are not displayed in the Stream Graph. This is a visual diagram for purposes of illustrating modes of workspace usage when working with Streams.

In this mode, a distinct copy of files from each stream is synced to the appropriate workspace on the user's machine. Every time a user needs to do work in a different stream, he switches his workspace and works on the set of files particular to that stream.

Mode 2: Use the same workspace and switch it between streams

Workspaces Streams Mode 2
Note: workspaces are not displayed in the Stream Graph. This is a visual diagram for purposes of illustrating modes of workspace usage when working with Streams.

This is the mode that would be preferred by most users familiar with Git. In fact, it was requested by a user who wanted streams to be more Git-like and we delivered. This mode is also very suitable for streams that contain large binary files that do not change often between streams.

P4V preferences

To enable this mode from P4V, select Preferences, the Connection tab and select the “Use the same workspace and switch it between streams” radio option (Note that prior to the GA release, this setting was called “Re-associate current workspace with target stream for merge, copy and "work in stream" operations”).

When using this mode, there is only one set of files on your local computer. Every time a workspace is switched to another stream, only the files that are different are re-synced.

Mode 3: User has multiple workspaces per stream, each dedicated to a different activity

Workspaces Streams Mode 3
Note: workspaces are not displayed in the Stream Graph. This is a visual diagram for purposes of illustrating modes of workspace usage when working with Streams.

In this mode users create a distinct workspace for each development task, for example a workspace for development, a workspace for merging, and a workspace for testing. A benefit of this approach is that work in progress does not conflict with performing a merge since these activities are done in separate workspaces in with distinct sets of files. A drawback of this approach is that it takes up a lot of space on the user's machine.

 

P4V Interaction Differences:

P4V InteractionModes 1 & 3Mode 2
Stream context 1
work in stream

Prompted to confirm the workspace switch, choose or create a workspace associated with the selected stream.

When creating new streams, a new workspace may be optionally created for use with the stream.

Current workspace is switched to the selected stream.

When creating new streams, the current workspace is switched to the new stream.

Any of the above operations with the "Don't warn me when switching workspaces" setting turned on in P4V Preferences

Prompt for confirmation is by-passed. When only one workspace exists for the stream, it is switched to. When more than one workspace exists for the stream, prompted to choose the workspace. When no workspace is associated with the selected stream, New Workspace dialog is displayed and stream field is set to the selected stream.

Current workspace is switched to the selected stream.

 

Pros and Cons of Each Mode:

 ProsCons
Mode 1

Less need to stop/shelve work in progress compared to Mode 2.

Takes up more local disk space, less suitable for large projects than Mode 2.

Mode 2

Requires the least amount of local disk space. Only files that are different between streams are synced to the workspace, which minimizes the re-compile time.

Users should shelve work in progress prior to switching to new stream so that their work in progress is saved and can be unshelved when they return to work in that stream, restoring the state of their workspace prior to the switch. When using sandbox, the shelving and unshelving is handled by the sandbox server automatically.

Mode 3

No need to stop/shelve work in progress since the workspaces are dedicated to different tasks.

Takes up even more local disk space than Mode 1, likely not suitable for large projects.