Create your first stream

A stream is where you store your work. The first stream is always a mainline stream. To learn more about streams, see Streams.

Tip

Helix Core Server allows a stream to be re-parented to any other stream with the same depot root. Although it is possible to have multiple mainline streams in a stream depot, we recommend that you create only one mainline for each stream depot. Having a single mainline stream in a stream depot:

  • avoids the possibility of accidentally re-parenting a child stream to a different mainline than that from which the stream originated
  • simplifies the visual representation in Helix Visual Client (P4V)

To create the stream:

  1. Issue the p4 stream command, specifying the stream depot name followed by the stream name.

    Here, we name the stream main, so its full name is //JameCode/main, and we use the -t option to specify the stream type as mainline:

    $ p4 stream -t mainline //JamCode/main

    Helix Server opens the stream spec in an editor:

    # A Perforce Stream Specification.
    #
    #  Stream:       The stream field is unique and specifies the depot path.
    #  Update:       The date the specification was last changed.
    #  Access:       The date the specification was originally created.
    #  Owner:        The user who created this stream.
    #  Name:         A short title which may be updated.
    #  Parent:       The parent of this stream, or 'none' if Type is mainline.
    #  Type:         Type of stream provides clues for commands run
    #                between stream and parent.  Five types include 'mainline',
    #                'release', 'development' (default), 'virtual' and 'task'.
    #  Description:  A short description of the stream (optional).
    #  Options:      Stream Options:
    #                       allsubmit/ownersubmit [un]locked
    #                       [no]toparent [no]fromparent mergedown/mergeany
    #  Paths:        Identify paths in the stream and how they are to be
    #                generated in resulting clients of this stream.
    #                Path types are share/isolate/import/import+/exclude.
    #  Remapped:     Remap a stream path in the resulting client view.
    #  Ignored:      Ignore a stream path in the resulting client view.
    #
    # Use 'p4 help stream' to see more about stream specifications and command.
    
    Stream: //JamCode/main
    
    Owner:  bruno
    Name:   main
    Parent: none
    Type:   mainline
    Description:
            Created by bruno.
    
    Options:        allsubmit unlocked notoparent nofromparent mergedown
    Paths:
            share ...

    A stream spec defines the stream’s name and location, its type, its parent stream, the files in the workspace view of workspaces bound to it, and other configurable behaviors. Note that the stream name is composed of the stream depot name followed by the stream name. You edit the stream spec’s fields to configure the stream’s behavior, as explained in Configure a stream.

  2. Save the file and exit the editor.

  3. Notice that the command line now shows Stream //JamCode/main saved.
  4. To verify that your mainline stream has been created, issue the p4 streams command to display a list of streams.

    $ p4 streams //JamCode/...

    This produces the following output:

    Stream //JamCode/main mainline none 'main'