The mkstream command creates a new stream that is based on an existing stream called the backing stream. A stream and its backing stream are sometimes referred to as "child" and "parent" streams, respectively.You can use the mkstream command to create dynamic, pass-through, and gated streams. Use the mksnap command to create snapshot streams. See Entity Names for information on naming streams.A dynamic stream is a stream whose content changes over time, with new versions promoted from child workspaces and/or from other dynamic streams. It also inherits versions from its parent stream. AccuRev creates streams as dynamic streams by default.A pass-through stream is a special kind of dynamic stream, so called because a version that is promoted to such a stream automatically passes through to its parent stream. The file does not become active in the pass-through stream (that is, the pass-through stream has no default group); it does become active in the parent of the pass-through stream.A gated stream is a stream that you use to control whether changes promoted into it are automatically promoted out of it, often based on meeting externally established criteria (such as passing a test suite or completing a successful nightly build, for example). Gated streams combine attributes of both dynamic and pass-through streams, and they have features that are unique to them. For example, like dynamic streams, the content of a gated stream changes over time; and like pass-through streams, versions promoted to a gated stream pass through it to the gated stream’s parent. Unique to gated streams is a special type of stream called a staging stream.See Chapter 8, "Using Streams to Support Continuous Integration" in the AccuRev Administrator’s Guide for more information on gated streams.A newly created stream contains the same set of element versions as its backing stream. (If you use the -t option when creating a dynamic stream, this is the set of versions that the backing stream contained at a particular point in time.) Thereafter, the dynamic stream’s contents can change, either “actively” or “passively”.The promote command places a new version of one or more elements in a stream. This is termed an “active change”, because it is the result of an explicit command (promote), and is recorded in the database as a transaction.Promoting versions of elements into a stream makes those elements “active” in the stream. (A stream’s default group is its set of “active” elements.) Those elements remain active in the stream until the versions are promoted out of the stream, or are purged from the stream.
• When you promote from a workspace or child stream of a gated stream, those versions become active in a staging stream -- an intermediate stream that AccuRev creates automatically when you create or reparent a workspace or stream off it. Changes promoted to a gated stream remain in the staging stream’s default group until they satisfy the criteria established on the gated stream; once they do, those versions are promoted automatically through the gated stream directly to the gated stream’s backing (parent) stream.Elements that are not currently active can still change, “passively”. Dynamic, pass-through, gated, and staging streams inherit changes automatically from their backing streams. If a new version of foo.c is promoted to a backing (parent) stream, this new version automatically appears in all of the child streams where foo.c is not currently active.In effect, the -t option “takes a snapshot” of the parent stream at a particular time, called the basis time. But the following are only similar, not quite identical:
• Both child streams initially get the same set of versions. And both child streams can keep new versions of elements. The difference is in promoting the new versions:
• In a child created with mkstream -t, you can promote versions to the parent (because the parent is a dynamic stream). The elements remain active in the child stream.(In other situations, elements become inactive in the child stream after a promotion. Such elements revert to “passively” using the parent stream’s version. In this situation, becoming inactive would make the elements revert to the version that existed at the time specified with mkstream -t. This “surprise” is avoided by having the elements remain active.)
• In a child of a snapshot, you cannot promote changes to the parent (because the parent is a snapshot, and thus immutable). You can propagate the changes to other dynamic streams using promote -s -S or the GUI’s Change Palette. This operation leaves the changed files active in the child stream.You may wish to avoid the complications described above by not using mkstream -t to create streams for active development. Instead, you can use mkstream -t to create “changeable snapshot” streams:
• Create a child stream using mkstream -t <time-1>, and prevent changes to the stream using lock. This is similar to creating a snapshot of the parent stream at <time-1>.
• Subsequently, after changes have been made in the parent stream, unlock the child stream, update its “snapshot” with chstream -t <time-2>, then lock it again.-s <stream>-b <backing-stream>-t <time-spec>Bases the new stream on the state of the backing stream at the specified basis time. A time-spec can be any of the following:
• Time in <"YYYY/MM/DD HH:MM:SS"> format, "2007/08/07 20:27:15", for example. Note that you must use quotes when specifying time-spec as YYYY/MM/DD HH:MM:SS to ensure that the entire argument is interpreted by the command shell as a single token.
• Time keyword: now
•
• Transaction number keyword: highestSee Using the -t Option above.When using the –t option, take into account the possibility of a timewarp. The AC_SYNC environment variable (see AccuRev User Preferences) determines how a timewarp will be handled. See also section System Clock Synchronization of the AccuRev Administrator’s Guide.Create a stream based on gizmo at the present time:Create a changeable snapshot of the gizmo stream at May 2nd, 2000 at 2:55pm:
Micro Focus |