Skip to main content
1-Visitor
October 31, 2013
Solved

Lock sandbox recursively by CLI without being prompted if already locked

  • October 31, 2013
  • 1 reply
  • 3743 views

I want to lock a whole sandbox recursively by CLI.

I use the command:

si lock --gui --filter=!file:*.html -R --revision=:member --sandbox=$MKS.sb

The problem is, if a member is already locked by me I will get a window mentioning it, that I have to click to continue the process.

How can I lock and not being prompted if files are already locked by me, by CLI?

Many thanks

Best answer by tdalon

If I use the command on the single member like this:

'si lock --gui --revision=:member D:\MATLAB\Sandboxes\#make\AVLab_P\_AVLabdev\Session\@AVLabSession\private\class_hdr.m'

I don't get a error dialog.

It seems to be linked to the -R on the whole sandbox syntax.

With a -R on revision=:working I don't get the error dialogs.

1 reply

16-Pearl
November 1, 2013

Hello Thierry,

In general, the command:

si lock --gui --filter=!file:*.html --filter=!locked -R --revision=:member --sandbox=$MKS.sb

will lock all of the unlocked members in the sandbox without providing you with any prompts regarding any member locks, because it will not check out any members with locks on them.

I believe if you want to be prompted regarding locks from other users, the following command should work (assuming you have a user ID of tdalon😞

si lock --gui --filter=!file:*.html --filter=!locked:tdalon -R --revision=:member --sandbox=$MKS.sb

Edit: In this second case, if user jsmith has a lock on a member, you will get a notification about that member, but you will not get prompted for members you have a lock on. Essentially, this is telling the si lock to skip members you already have a lock on.

Regards,
Kael

Message was edited by: Michael Lizak Edit 2013-11-01EDT1443 Note about second option prompting if someone other than you has a lock on the file.

tdalon1-VisitorAuthor
1-Visitor
November 12, 2013

Unfortunately I observe something else. See error dialog:

Lock-Error.png

21-Topaz I
November 12, 2013

Hi Thierry,

For the class_hdr.m file mentioned in your screenshot, are there more revisions than just 1.1? If so, it looks like you already have a lock on 1.1 while the member revision is something else. In your sample command you specify "member" as the revision you want to lock, so I would guess that you actually want to remove that lock first and then get a lock on whatever the member revision happens to be.