Working with streams

Streams provide an alternate approach to maintaining codelinesClosed A set of files that evolve collectively. One codeline can be branched from another, such as a release codeline from a development codeline. This allowing each set of files to evolve separately..

Starting with release 2012.1, P4Eclipse provides the following support for streams:

  • Creating a Stream Spec
  • Populating a Stream
  • Viewing Stream Hierarchy
  • Creating a Stream Client
  • Copying and Merging Changes between Streams

If your organization uses streams, you will see streams depots in the P4 Connections view. Streams depots are marked with the Stream Depot icon image icon. A hierarchical view of the streams and their relationships to each other is displayed in the P4 Streams view, along with each stream's name, root, parent, owner, type, and description. If P4V (Perforce Visual Client) is available, you can also obtain the P4V Streams Graph by clicking the Stream Graph button Stream Graph button image in the P4 Streams view.

Streams view in Perforce perspective image

P4 Streams view buttons:

Button Description
Flat Mode button image Display Streams in a list view in the P4 Streams view.
Tree Mode button image Display Streams in a tree view in the P4 Streams view.
Stream Graph button image Display Streams in a P4V Streams Graph, only available if the P4VC executable is installed.
Expand All button image Expand all the streams
Collapse All button image Collapse all the streams
Refresh button image Refresh the streams in the P4 Streams view.
 Open Preference Page button image Opens the Streams Preferences dialog.
Create New Stream button image Starts the New Stream wizard so that you can create a new stream, see Create a stream spec for details.

Create a stream spec

  1. From the P4 Streams view (or the Create New Stream from... context menu item), click the Create a New Stream button Create New Stream button image.
  2. The New Stream wizard will is displayed.

  3. To create a new Stream spec, follow the wizard's prompts and click Finish.
  4. Click the Refresh button Refresh button image on the view toolbar to refresh the view and display the new stream.

Populate a stream

A stream spec defines a path in the stream depot. If the path does not exist, you need to populate the stream with content.

Populate a stream in Eclipse:

You can check the Branch files from parent on stream creation button in the New Stream wizard.

Alternatively, you can:

  1. Create a new connection in the P4 Connections view and set your Perforce workspace's Stream value to the stream you want to populate.
  2. In the P4 Stream view, select the stream and choose Merge to Stream.
  3. Select the parent stream as the source, select Merge. Resolve any files (accepting the source), and then submitClosed To send a pending changelist from the client workspace to the depot. the changelistClosed The changes to files or stream specifications along with metadata, such as the list of changed files, their version numbers, who submitted the changelist to the depot, and the submitter's description of the changes. A changelist is the unit of versioned work. See also atomic change transaction and changelist number..

Populate a stream with P4V:

If you are familiar with P4V, you can use it to populate the stream.

  1. Invoke the P4V graph view Streams graph view button image to populate the stream from the P4 Streams view.
  2. Note

    In order to enable context menu functionality in the stream graph, you will need to select the P4V Preference named Use the same workspace, and switch it between streams. (You can set this preference in the Streams page of P4V Preferences.)

  3. Use the context menu in the P4V Graph View as you would if you were in P4V.

Delete a stream

Note

You can only delete a stream if it has no children.

  1. Right-click the stream you want to delete in the P4 Streams view.
  2. Select Delete Stream from context menu.
  3. Click Yes when prompted to confirm the stream deletion.

View stream hierarchy

The P4 Streams view can show streams either as a tree Streams Tree button image or list Streams List button image. If you have P4V configured in the preferences page, the P4V Stream Graph view can also be invoked from the P4 Streams view toolbar Streams graph button image.

Create a stream client

To work with a stream depot, a stream client is needed. To create a stream client, select a connection from the P4 Connections view, select Edit Perforce Workspace... from the context menu, set the Stream field (and optionally, specify the AtChange field), and save the spec.

Streams client dialog image

Work in a stream

Alternatively, you can select the context menu Work in this Stream... of the P4 Streams view, P4Eclipse will prompt you to either update the current Perforce client to associate with selected stream, or create a new client to associate with the selected stream, based on the preference. The default behavior is to update the current client to associate with the selected stream.

Once you select the stream client, P4Eclipse will automatically switch the Perforce workspace and synchronize the existing projects to the latest revision.

Copy and merge changes between streams

Consider the following set of streams:

Streams Graph view image

After fixing a bug or implementing a new feature in a development stream, you may want to copy up your changes to the main stream or you may want to merge them down from the main stream to the development stream.

Note

P4Eclipse release 2012.2 and earlier:P4Eclipse will not automatically switch to the target stream when copying to the stream or merging to the stream. You must manually switch to the target streams when copying and merging to the stream.

Auto-switch streams

When you select the Copy to Stream... or Merge to Stream... actions, P4Eclipse will automatically switch to the target stream if necessary.

Copy changes from the development stream to the main stream:

  1. Open P4 Streams tab view, and select the main stream, right-click Copy to Stream..., if you are currently in dev stream, P4Eclipse will automatically switch to the main stream, and synchronize the resources.
  2. You can then follow the prompts from the Copy to Stream wizard, and click Copy to finish.
  3. Resolve the pending changelist and submit the change.

Merge changes from the main stream to the development stream:

  1. Open P4 Streams view, and select the dev stream, right-click Merge to Stream..., if you are currently in main stream, P4Eclipse will automatically switch to the dev stream, and synchronize the resources.
  2. You can then follow the prompts from the Merge to Stream wizard, and click Merge to finish.
  3. Resolve the pending changelist and submit the change.

Work with task stream

Task streams provide a light way to branch streams. Usually you work with a task stream for a minor bug fix or a small feature development.

P4Eclipse provides following support for task streams, and most of them are available from the P4 Streams view:

  • Create a task stream
  • Populate a task stream
    • From parent stream
    • From a depot
  • Work in a task stream
  • Delete a task stream
  • Unload/reload a task stream
  • Re-parent a task stream

Task stream workflow

The following workflow is suggested but not required:

  1. Create a task stream related to a task (feature or bug)
  2. Checkout files in the task stream
  3. Modify the files in the task stream
  4. Submit files to the task stream
  5. Copy changes up to the parent
  6. Unload or delete the task stream