It's all about the answers!

Ask a question

How to lock a folder or component under RTC source control

guoping chen (191014) | asked Jul 15 '14, 9:43 a.m.
edited Oct 06 '17, 12:11 a.m. by David Lafreniere (4.7k7)

I want to lock a folder or component under RTC source control.

But I can not find any option(menu list-->lock folder).

In the Source control --> View repository files option, It is possible to LOCK a file (Lock option is available in the right click menu). But UNLOCK option is not available to folder.

The function of Lock a folder is provided by RTC source control?


Daniel Kalinski commented Jul 18 '14, 12:21 p.m.

You can refer to this topic for locking/unlocking folder.

Geoffrey Clemm commented Jul 19 '14, 2:56 a.m.

Note: Topic 64030 is about unlocking a folder that was left locked by an incomplete operation from the browser, but does not provide a way to lock a folder.
Guoping: What was your reason for wanting to lock a folder?

Accepted answer

permanent link
David Lafreniere (4.7k7) | answered Oct 06 '17, 12:11 a.m.

As of RTC 6.0.5 there is still no way to lock a folder (such that all child files will be locked).
As mentioned in the other answers, these requests are tracked here:
Read and write permissions at the folder level. (63844)
Provide write permission at the versioned item granularity (171106)

Here are some other ways to have multiple files locked in batch:

Locking the Entire Stream or Component:

In RTC 6.0.2 we added a feature that lets you lock streams and components to prevent deliveries to the files in those streams or components. Stream and component locks work in a similar manner to file locks but apply to the entire stream or the entire component in a stream. When a stream or component is locked, any attempted deliveries by users who do not own the lock will fail with an appropriate error message. The user that holds the lock can still perform deliveries to the stream. A lock does not only prevent deliveries, it also prevents any operation that affects the files in the locked component or stream. For example, a component replace is also prevented.

-New & Noteworthy Mention:
-Stream/Component Locking Demo Video:
-SCM Command Line Client 'set lock' command:

Prior to 6.0.2, one approach might be to add a deliver advisor in the process spec to restrict deliveries to particular streams. By protecting your stream by particular roles or users, you can effectively lock the stream down.
"" describes how to protect individual components in a stream, the same approach can be used to lock down the entire stream.

Using the CLI (could write a custom script to automate this)
You could use the scm commandline which allows you to specify multiple files... 'scm lock acquire -r <repo> -s <stream identifier> -R'
To get the list of files in a component you could use the following command... 'scm list remotefiles -r <repo> <stream identifier> <component identifier>'
To get an output that is consumable you could use the --json option.

Multi-selection in the Rich Clients (Eclipse/Visual Studio)
You can multi-select files in the Package Explorer or the Repository Files view and use the Lock context menu action action. There is no way to select a folder however, and have it recursively lock all child files.

Michael Valenta selected this answer as the correct answer

Your answer

Register or to post your answer.