2. AccuRev® Command-Line Reference : lock

lock
lock a dynamic stream against promotions
Usage
accurev lock [ -c <comment> ] [ -kf | -kt ]
[ { -e | -o } <principal-name-or-group-name> ] <stream>
Description
The lock command prevents users from make various changes to the specified dynamic stream:
With no -k option, the command creates an “all” lock, which:
prevents users from promoting versions either to or from the specified stream
With -kf, the command creates a “from” lock, which prevents users from removing versions from the stream’s default group. This means that users cannot:
promote versions from the specified stream to other streams
With -kt, the command creates a “to” lock, which prevents users from adding versions to the stream’s default group, for example, via promoting versions to the specified stream from other streams.
Usage of both -kf and -kt in the same command is not valid (the first option appearing on the command line is taken, and the second is ignored). But you can use these two options in separate lock commands, to establish both “from” and “to” locks on the same stream.
By default, the lock applies to all users. The -o <principal-name> option makes the lock apply only to a specified AccuRev user. Similarly, the -o <group-name> option makes the lock apply only to the members of the specified AccuRev group.
Conversely, use the -e option to make the lock apply to everyone but the specified AccuRev user or group. That is, the specified user or group will be able to perform promotions, but no one else will.
Limitations on Locking
A stream can have at most one lock of each type — “all”, “from”, or “to”. This means you cannot use multiple lock -o commands to lock a stream for users tom, dick, and harry. To accomplish this, put these users in an AccuRev group and apply a lock to that group.
For a given user, an “all” lock overrides “from” and/or “to” locks.
An “all” lock on a stream does not prevent the stream from being deactivated with remove.
Locks and Virtual Versions
AccuRev’s system of real versions and virtual versions means that a version of an element seems to exist in multiple streams at once. A lock on one of those streams does not apply to any of the other streams. For example, suppose you create a real version of a file in workspace stream gizmo_dvt_derek, and then promote this version to stream gizmo_dvt. If you put a “from” lock on stream gizmo_dvt_derek, you can still promote the version from stream gizmo_dvt to another stream.
Removing Locks
Use the unlock command to remove an existing lock. Placing a new lock on a stream automatically removes any existing lock of the same type. For example, if you issue the following commands, the result will be a “to” lock for everyone and a “from” lock for everyone except john.
accurev lock -kf -e tom stream1
accurev lock -kt stream1
accurev lock -kf -e john stream1
Options
-c <comment>
Specify a comment that will be displayed in the future when this lock prevents a user from promoting a version. The next command-line argument should be a quoted string. Alternatively, the next argument can be in the form @<comment-file>, which uses the contents of text-file <comment-file> as the comment. Default: no comment is associated with this lock.
-kf
(“from” lock) Disallow promotions from the stream and purging versions in the stream. Cannot be used with -kt.
-kt
(“to” lock) Disallow promotions to the stream. Cannot be used with -kf.
-o principal-name-or-group-name
Make the lock apply only to the specified AccuRev user, or only to the members of the specified AccuRev group. Cannot be combined with -e.
-e principal-name-or-group-name
Make the lock apply to everyone but the specified AccuRev user, or to everyone but the members of the specified AccuRev group. The specified user or group will be able to perform promotions, but no one else will. Cannot be combined with -o.
Examples
Disable all promotions to and from stream tulip_dvt; also disable include/exclude changes and chstream changes:
> accurev lock tulip_dvt
Disable all promotions from stream tulip_dvt:
> accurev lock -kf tulip_dvt
Allow user mary to make promotions to stream tulip_dvt, but disallow everyone else from doing so:
> accurev lock -kt -e mary tulip_dvt
See Also
chstream, promote, remove, unlock

Micro Focus