November 3, 2015

Under the Hood with P4D 2015.2 Streams Enhancements, Part One

Helix Core

Last week's P4D 2015.2 server release includes a number of useful enhancements for streams. Today I'll talk about a few of the relatively small ones.

Stream Depth

Since streams were first implemented, one of the most common requests has been for a way to create directory structures that allow streams within a single stream depot.

            #1052310, 1009333 (Bug #50432) **
                Add the ability to root streams at a deeper level in the depot
                directory hierarchy.  New stream depots contain the 'StreamDepth'
                field for defining the root level of a stream's path (the number
                of slashes found within the stream's Stream field) below the
                depot name. This field accepts a value between one and 10, while
                it defaults to one.

Historically, streams have been required to have names of the form //DEPOTNAME/SOMETHING.  The streams within a particular depot continue to follow this naming convention, but as of 2015.2, naming is configurable per depot. As a result, you can now define a stream depot with a depth of //DEPOTNAME/1/2/3 to create a deeper directory structure within the root depot.

Switch @change

            #1039642 (Bug #77628) **
                'p4 switch' now supports switching to a point-in-time stream.
                By specifying 'p4 switch stream@change' the command will set
                the stream spec/view creation as of that change and sync any
                files also to the change specified.

This is a small piece of syntactic sugar that makes it easier for you to use the existing StreamAtChange field in the client spec by allowing it to be specified as part of the "p4 switch" command line.  Since "p4 switch" syncs the files as well as setting up the client view, this makes "p4 switch stream@change" a one-step way to sync your client to a historical version of a stream.

Current Stream as Default

            #1100312 (Bug #79497) **
                The 'p4 stream' and 'p4 stream -o' commands now default to
                the current client's stream if no stream name is specified.

Another piece of syntactic sugar to make working with streams a little bit easier. If your current client has an associated stream, you can now view that stream spec by running "p4 stream -o" with no arguments, and edit it with "p4 stream", much like you would use "p4 client -o" and "p4 client" with a ‘classic’ client.

Import @label

            #1029470 (Bugs #72671, #76543) **
                Names of automatic labels can now be used as specifiers in import
                mappings on stream specs and in the 'ChangeView' on client specs.

This is an oft-requested minor extension to the import @change/ChangeView feature: being able to specify a label in place of a changelist number.  Note that this is only meant to be used with labels that are themselves aliases for changelists; to set up one of these labels, clear the label's View field and enter "@CHANGELIST" in the Revision field.

Stay tuned for my next post wherein I'll talk about the really BIG new streams feature for 2015.2...