Task streams
Task streams are lightweight short-lived streams used for bug fixing or new features that only modify a small subset of the stream data. Since branched (copied) files are tracked in a set of shadow tables that are later removed, repository metadata is kept to a minimum when using this type of stream and server performance is optimized.
They are branches that work just like development streams, but task streams remain semi-private until branched back to the parent stream. Designed as lightweight branches, they are most effective when anticipated work in the branch will only affect a small number of files relative to the number of files in the branch.
DVCS does not support task streams.
Task streams are intended to be deleted or unloaded after use. Because you cannot re-use task stream names even after the stream has been deleted, most sites adopt a naming convention that is likely to be unique for each task, such as user-date-jobnumber.
Working within task streams is just like working in a development stream:
-
Create the task stream (in this example, as a child of a development stream).
$ p4 stream -t task -P //projectX/dev //Tasks/mybug123
-
Populate the stream.
$ p4 populate -d "Fix bug 123" -S //Tasks/mybug123 -r
- Make changes to files in the stream and submit the changes.
-
Merge down any required changes from the parent stream, resolving as necessary.
$ p4 merge
-
Copy up the changes you made into the parent stream.
$ p4 copy --from //Tasks/mybug123
-
Delete or unload the task stream.
$ p4 stream -d //Tasks/mybug123
Alternatively, use
p4 unload
to unload it:$ p4 unload -s //Tasks/mybug123
See Deleting versus unloading task streams for more information on deleting versus unloading task streams.
Only workspaces associated with the task stream can see all the files in the stream; the stream appears as a sparse branch to other workspaces, which see only those files and revisions that you changed within the task stream. Most other metadata for the task stream remains private.
Task streams can quickly accumulate in a depot until they are deleted or unloaded; to keep a project depot uncluttered by task streams, your Helix server administrator or project lead may choose to establish certain streams depots as dedicated holding areas for task streams. In this case, create your stream in the task streams depot as a child of a parent in the project depot.
Task streams are unique in that they can live in different depots from their children or parents. However, the best practice is to have them reside in the same depot as their children or parents.
Deleting versus unloading task streams
To free up space in Helix server database tables, you can choose to either delete or unload task streams. Deleting has no recovery option; you cannot work on that task stream again once you’ve deleted it. Unloading gives you the option of recovering the task stream to work with it again.
You unload a task stream using the p4 unload
commmand. For more information, see the p4 unload
page in
Helix Core P4 Command Reference.