lock acquire

Lock files in a stream.

Purpose

Allow the user to lock files in a stream. Locking a file prevents other users from delivering change sets that modify it.

Options and arguments

-R  |  --remotePath ]
Flag indicating that all paths are remote. Necessitates the presence of –stream and –component.
-s  |  --stream ] arg
Indicates which stream the lock should be acquired in. Required when "-R" is used.
-c  |  --component ] arg
Indicates which component in the lock should be acquired in. Required when "-R" is used.
files
Path to one or more files to lock. The paths may be local or remote, depending on the presence of –R/--remotePath.

Examples

It is possible to lock files in the default flow target of a loaded workspace by specifying the path to the individual files:

$ scm lock acquire hello.world/build.xml
Locks successfully acquired.

In this example, the current working directory has a workspace loaded into it. The file is locked in the flow target. Note that the user has run 'scm login' against the appropriate repository in this example.
It is possible to lock a file in a stream that is not the default flow target by specifying –stream:

$ scm lock acquire hello.world/build.xml --stream "JUnit Integration Stream"
Locks successfully acquired.

It is possible to lock files without having a workspace loaded:

$ scm lock acquire -r l --stream "JUnit Exploration Stream" --component BuildComp -R hello.world/chatter.txt hello.world/.project
Locks successfully acquired.

This example locks chatter.txt and .project in the hello.world directory of the component BuildComp in the stream “JUnit Exploration Stream”. Note the use of “-R” to indicate that the paths are remote.

Feedback

Did this help? You can provide feedback at Jazz.net (registration required): Comment in the forums or submit a bug