Working with task streams

Task streams are lightweight branches that you can use for work that affects a small portion of a full project branch. Task streams enable you to work privately, switch contexts quickly, and reduce the amount of metadata managed by the Perforce service. They are ideal for developing small-to-medium features and bug fixes.

Overview

Task streams are sparse and semi-private:

A task stream is only visible in the depot tree pane if that task stream is populated, has a workspace, and that workspace is the selected workspace.

The typical task stream workflow usually ends with the task stream being deleted or unloaded:

  1. Create a task stream from a parent stream (although a parent is not required).
  2. Populate the task stream.
  3. Work on a new feature and submit the code.
  4. Merge down changes from the parent stream to the task stream.
  5. Copy your changes up.
  6. Delete or unload the task stream.

You do not always have to delete or unload the task stream. For example, if you find yourself editing more than half the files in your task stream, that stream will no longer provide any savings in server overhead or metadata management activity. It can make sense then to convert your task stream into a regular stream.

Using a task stream feels just like using a regular stream, with the following exceptions:

Create a task stream from a parent stream in the same depot

  1. In the Streams tab, right-click the parent stream and select Create New Stream from 'stream_name'…​
  2. In the Stream:New dialog, define the new stream.

  3. Verify that the new task stream appears correctly in the Stream Graph.

    Refresh the Stream Graph view. You may need to select the task stream under Graph View Options. The task stream should appear as a child of its parent and be decorated with the task stream icon: taskstream badge .

Create a task stream in a different depot

  1. Open the Stream:New dialog.

    You can open the dialog by doing any of the following:

  2. In the Stream:New dialog, define the new stream.

  3. Refresh the Stream Graph view to verify that the new task stream appears correctly.

Create a task stream without a parent

  1. Open the Stream:New dialog.

    You can open the dialog by doing any of the following:

  2. In the Stream:New dialog, define the new stream.

  3. Verify that the new task stream appears on the Streams tab.

    Parentless task streams do not appear in the Stream Graph, since there is no relationship to display. You can view parentless task streams in the Streams tab using List or Tree view.

  4. Populate the new task stream.

  5. Verify that the new task stream is populated.

Convert a task stream to a regular stream

Important

Once you convert a task stream to a regular stream, you cannot convert it back.

To convert a task stream to a regular stream:

  1. Right-click the task stream in the Streams tab and select Edit Stream 'stream_name'.
  2. Change the Stream type to the regular stream type you want.

  3. Verify that the parent stream (if there is one) is in the same depot as the task stream to be converted.

Delete and unload task streams

You should always delete or unload a task stream after you are done with it. Your Helix Server administrator may also run a batch process to delete or unload inactive task streams on a regular basis. Note that any submitted files remain in the depot even after you delete a task stream. Note also that you cannot re-use the names of deleted task streams.

To delete a task stream:

  1. Right-click the stream in the Streams tab (in graph, tree, or list view)
  2. Select Delete Stream 'stream_name'.

Unloading transfers infrequently-used metadata from the versioning engine’s database files to a set of flat files in an unload depot. If you unload a task stream, you can reload it if you change your mind and want to use it again.

To unload a task stream:

  1. Right-click the stream in the Streams tab (in graph, tree, or list view).
  2. Select Unload stream 'stream_name'.

To reload an unloaded task stream:

  1. Display the Streams tab in List or Tree view.
  2. Select the unloaded Unloaded…​ icon in the filter pane to open the Unloaded Streams dialog, where you can filter for and select unloaded streams to reload.
  3. Right-click the stream and select Reload Stream.

For more information about unloading, see the P4 Command Reference.

Filter task stream files out of File History results

To filter out file revisions that were submitted to task streams when you view file history:

  1. Go to P4V > Preferences(Mac) or Edit > Preferences (Windows) and select Files and History.
  2. Select Hide files/revisions from 'task' streams (when following branch, copy actions).