p4 stream
Create or edit an instance of a stream (also known as a stream definition).
Syntax
p4 [g-opts] stream [-P parent] -t typename
namep4 [g-opts] stream [-f -d] [-o [-v]] [-P parent] -t typename
[name[@change]]p4 [g-opts] stream -i [-f]
namep4 [g-opts] stream edit
p4 [g-opts] stream resolve [-a flag] [-n] [-o]
p4 [g-opts] stream revert
Description
The p4 stream
command enables you to maintain
Helix server
streams, which are hierarchical branches with policies that control the
structure and the flow of change. Stream hierarchies are based on the
stability of the streams, specified by the type you assign to the stream:
mainline |
|
development |
|
release |
|
task |
|
virtual |
|
Stream contents are defined by the paths that you map. By default, a stream has the same structure as its parent (the stream from which it was branched). However, you can override the structure. For example, your override might ensure that specified files cannot be submitted or integrated to other streams.
By default, p4 stream
edits the stream associated
with your current workspace. It throws an error if you’re not using a
stream workspace. For more information, see the "Streams" chapter of the
Helix Core Server User Guide.
For details on the recommended workflow to edit, resolve, and revert a stream, see "Update Streams" in Helix Core Server User Guide.
If you integrate from a classic branch or other stream depot to a task stream, the files are not copied up to the parent unless they are edited and submitted first.
For a detailed discussion of streams, see the Streams chapter of the Helix Core Server User Guide.
Private editing of streams
If a user edits a stream spec publicly and saves the spec, the changes take effect immediately. In some cases, this can affect other users in unwanted ways. For example, changing any dependency, such as product component, might break a product build.
Private editing of streams allows you to:
- modify a stream spec and stream depot files in isolation from other users of that stream
- test the modifications before submitting them, and you can shelve the modifications for another user to test
- improve the visibility and tracking of how the stream spec evolves because a single "atomic" changelist can contain your edits to the stream spec and any associated code changes
Prior to this release, a user could edit a stream spec privately by using the p4 stream edit command, which is still supported. For example,
p4 -c aStreamClient stream edit
Stream //Ace/Main@15973 - edit stream spec default change
However, if you use p4 stream edit the changelist does not track edits to the stream spec.
The workflow for private editing of streams corresponds to your normal workflow with the p4 edit, p4 submit, p4 revert, and p4 resolve commands. These commands have been enhanced with the -So, -Si, or -Sx options to include or exclude stream specs edits.
See also the p4 help streamcmds command-line output.
- To learn how to create a stream depot and set its StreamDepth, see Working with stream depots in the p4 depot command.
- For a complete explanation of the different types of streams and how to use them, see the Streams chapter in the Helix Core Server User Guide, including the "Update streams" topic.
Stream and graph depot - .git suffix and repo path
A stream can import a repo from a depot of type graph. Within the stream, the content of the import is read-only. The examples below show that:
- the .git suffix is required
- the repo path must include a specific SHA-1 or ref
@sha |
Syntax: import path/... //repo/name.git/restricted/view/path/...@sha Example: import d3/... //repo/d3.git/*.js@c2e37352ac84eb8f90bc2866f715 The imported data is locked at the time of the @sha. |
@ref |
Syntax: import path/... //repo/name.git/restricted/view/path/...@ref Example: import d3/... //repo/d3@refs/heads/master A sync updates the data to the current time of the @ref. |
See Working with depots of type graph.
Form Fields
Field Name | Type | Description |
---|---|---|
|
Writable, mandatory |
Specifies the stream’s name (permanent identifier) and its path
in the stream depot, in the form
Be aware of the Limitations on characters in filenames and entities. |
|
Read-only |
The date the stream specification was last modified. |
|
Read-only |
The date and time that the stream specification was last accessed by any Helix server command. |
|
Writable, mandatory |
The Helix server user or group who owns the stream. The default is the user who created the stream. |
|
Writable |
Display name of the stream. Unlike the |
|
Writable |
The parent of this stream. Must be |
|
Writable, mandatory |
The stream’s type determines the expected flow of change. Valid
stream types are
|
|
Writable, optional |
Description of the stream. |
|
Writable |
Settings that configure stream behavior as follows:
A Flow options are ignored for |
|
Writable |
Paths define how files are incorporated into the stream structure. Specify paths using the following format:
where The default path is Valid path types are:
By default, streams inherit their structure from the parent stream (except mainlines, which have no parent). Paths are inherited by child stream views. A child stream’s path
can downgrade the inherited view, but not upgrade it. (For
example, a child stream can downgrade a Note that the Tip
In a virtual stream, when you import paths, be specific and provide Stream //project1/mainQ mainline none 'mainQ' Stream //project1/devQ1 development //project1/mainQ 'devQ1' Stream //project1/devQ1-virt virtual //project1/devQ1 'devQ1-virt' and you use Paths: import foo/... share foo/src/libs/lib1/... Although you might expect that the
Therefore, we recommend that you use this more explicit syntax:
Note
To manage files of similar file-type in your stream specs, consider using wildcards (... and *) explicitly following the final slash in the path definition:
|
|
Writable, optional |
Reassigns the location of workspace files. To specify the source path and its location in the workspace, use the following syntax:
where
Line ordering in the |
|
Writable, optional |
A list of file or directory names to be ignored in client views. For example: /tmp # ignores files named "tmp" /tmp/... # ignores directories named "tmp" .tmp # ignores file names ending in .tmp Lines in the |
Options
|
Delete the stream specification. A stream specification cannot be deleted if it is referenced by child streams or stream client workspaces. Deleting a stream does not remove its files. However, changes can no longer be submitted to the stream. |
|
Administrators can use the |
|
Read the stream specification from standard input. |
|
Write the stream specification to standard output. By default,
it outputs the stream associated with the current workspace. If
you pass the Warning
Limitation: Although this option requires the user have at least the list access to the stream path, it ignores any other entry in the protections table, including any minus sign (-) that would otherwise block the operation. |
|
Verbose option; includes the automatically-generated client view for this stream. |
|
When creating a new stream specification, specify the stream’s parent. (This option has no effect on an existing stream specification.) |
|
When creating a new stream specification, you must specify the
stream’s type: either |
|
For |
|
For |
|
For |
|
For |
|
For |
|
For |
|
For |
|
See Global options. |
Usage Notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
N/A |
N/A |
or list to use the -o option |
- As the name implies, task streams are intended to be short-lived; after you have finished using a task stream by promoting your changes to its parent, delete the task stream.
Examples
p4 stream -t mainline //streams/product1 | Create a mainline stream in the depot named streams |
|
Create a development stream for project X by branching the mainline. |
Related Commands
List streams |
|
Edit template for streams | p4 streamspec |
Create stream depot |
Your search for returned result(s).