Editing streams

You can edit streams in the following ways:

  • Publicly: Any changes you save immediately propagate to everyone using the stream. Testing is basic and traceability is minimal.
  • Privately, by checking out the stream: Any changes you make are saved in a changelist.
    The changes only become public when you check in the changes.
    Private editing of a stream allows for:

    • testing changes to a stream before checking in those changes
    • traceability of changes to a stream in changelists

Edit a stream publicly

Use caution when performing public edits because they could block other users. Only perform public edits when the changes to the stream configuration are straightforward and safe. When you save these changes, they immediately apply to everyone using the stream.

To edit a stream publicly:

  1. In the Streams tab or the Stream Graph tab, right-click a stream, and select Edit Stream '<stream_name>'.
  2. In the Stream: Edit window, make the required changes to the stream spec.
  3. Click Apply to save the changes and keep the window open, or click OK to save the changes and close the window.

Edit a stream privately

Editing a stream privately lets you make configuration changes in isolation from other users of that stream. This is the recommended method for editing streams. This method checks out the stream to the default changelist so that you can test the changes in an isolated environment before checking them in, which makes them public.

Changelists that include a stream include a stream badge for immediate visibility, such as this one: Changelist icon with stream badge. In this case, the changelist icon is blue because it does not contain any open files, only the checked out stream.

When all work on the stream configuration, and any associated code changes, is complete, you can submit the stream and any related files together in a single atomic changelist, which improves visibility and tracking.

The maintained history allows you to later go back and check what you changed, when you did it, and what other, related code changes you submitted at the same time.

If P4V detects any conflicts upon checkin, a question mark appears on the stream icon in the changelist Checked out stream with conflicts icon and you cannot submit the changelist.

P4V provides different ways to resolve conflicts. For details, see Resolving streams.

To edit a stream in private:

  1. Make sure that your workspace matches the stream you want to edit.
  2. In the Streams tab or the Stream Graph tab, right-click a stream and do one of the following:

    • To check out the stream and edit it immediately:

      Select Check Out and Edit Stream '<stream_name>'.

      P4V checks out the stream, places it in the default changelist, and opens the Stream: Edit window.

    • To check out the stream, move it to a different changelist, and then edit it:

      1. Select Check Out Stream '<stream_name>'.

        P4V checks out the stream and places it in the default changelist.

      2. To move the stream to a different changelist, do one of the following in the Pending tab:

        • Drag the stream from the default changelist to the changelist of your choice.
        • Right-click the pending changelist, select Move to Another Changelist, and, in the Select Pending Changelist dialog, select the changelist that you want to move it to and click OK.
      3. Right-click the stream again and select Edit Checked Out Stream '<stream_name>'.

        P4V opens the Stream: Edit window.

    In the Stream Graph tab, the workspace icon for the stream turns red as an indicator that this stream is currently checked out: Red workspace icon in Stream Graph indicates checked out stream

  3. In the Stream: Edit window, make the required changes. For information on the available fields, see Creating streams.
  4. Click Apply to save the changes and keep the window open, or click OK to save the changes and close the window.
  5. Make sure everything is working as expected with the changes you made. If needed, fix any code in other files that needs to be adjusted. Ideally, you make those code changes against the same changelist so that you can then submit the code changes and the updated stream configuration in a single, atomic operation.
  6. On the Pending tab, do the following:

    • If the stream icon in the changelist indicates a conflict (Checked out stream with conflicts icon), resolve the conflict before you continue. For more information, see Resolving streams.
    • If the changes look good to you and the stream icon in the changelist does not indicate any conflicts, right-click the changelist with the stream and select Submit.

      The Submit Changelist window opens. The stream is automatically selected for submit. Then continue with step 8.

    • If you are not sure about your changes and want to discard them, right-click the stream and select Revert Stream '<stream_name>'.
  7. In the Submit Changelist window:

    • If there are any files that you do not want to submit yet, clear the check boxes for those files.
    • Select any other options that apply.

    For more information on submitting files, see Checking in files.

  8. Click Submit.

See also: Shelving streams.