LOCK LIST
Description
Shows locks on a server.
Usage
cm lock list | ls [<revspec> [ ...]] [--server=<server>] [--repository] [--onlycurrentuser] [--onlycurrentworkspace] [--ignorecase] [--anystatus] [--machinereadable [--startlineseparator=<sep>] [--endlineseparator=<sep>] [--fieldseparator=<sep>] [--smartlocks]]
Options
Option / Argument | Description |
---|---|
--server | Repository server specification. This option will override the default server which is retrieved from the current workspace or the client.conf file. (Use 'cm help objectspec' to learn more about server specs.) |
--repository | Repository specification. This option will only list the locks of the specified repository. (Use 'cm help objectspec' to learn more about repository specs.) |
--anystatus | Shows locks in any status (Locked or Retained). By default, only locks in Locked status are shown. |
--onlycurrentuser | Filters the results showing only the locks performed by the current user. |
--onlycurrentworkspace | Filters the results showing only the locks performed on the current workspace (matching them by name). |
--ignorecase | Ignores casing on the paths when a serverpath spec is used. With this flag, the command will work for "/src/foo.c" even if the user writes "/sRc/fOO.c". |
--machinereadable | Outputs the result in an easy-to-parse format. |
--startlineseparator | Used with the '--machinereadable' flag, specifies how the lines should start. |
--endlineseparator | Used with the '--machinereadable' flag, specifies how the lines should end. |
--fieldseparator | Used with the '--machinereadable' flag, specifies how the fields should be separated. |
--smartlocks | Used with the '--machinereadable' flag, shows all the smart lock fields. Otherwise, it only shows the legacy locks fields. This parameter is needed to avoid breaking compatibility with older integrations / plugins that expect the old format. |
revspec | If one or more are present, this command will display one lock line for each specified revision if its associated item is locked in the server. Otherwise, this command will list all locked items in the default server (or the one set with the '--server' option). Use a whitespace to separate the rev specs when using more than one. (Use 'cm help objectspec' to learn more about rev specs.) |
Help
Remarks
The command will display a list of the currently locked items in the default server. It also accepts a list of revision specifications. In this case, only the locks belonging to the selected items will be displayed. A '--server=<server>' can be used to set the default server to query.
The command shows a line for every lock in the specified server
- Repository of the locked item.
- Item id of the locked item.
- GUID of the locked item (this is only printed with the --machinereadable flag).
- Date of the lock.
- Destination branch where the lock will be released.
- Revision id of the item loaded in the destination branch.
- Holder branch where the lock was performed.
- Revision id of the item that currently holds the lock.
- Status of the lock (Locked or Retained)
- User name who performed the lock.
- Workspace name where the lock was performed.
- Path of the locked item (server path format).
For the --machinereadable without the --smartlocks option, the printed fields are:
- GUID of the locked item.
- User name who performed the lock.
- Workspace name where the lock was performed.
- Path of the locked item (server path format).
Examples
cm lock list
cm lock list --server=myserver:8084
cm lock list --repository=repo@myserver:8084 --anystatus
cm lock ls serverpath:/src/foo.c#cs:99@default@localhost:8084
cm lock list revid:3521@default itemid:2381@secondary --onlycurrentuser
cm lock ls --onlycurrentuser
cm lock ls --onlycurrentuser --onlycurrentworkspace
cm lock list --machinereadable --startlineseparator=">" --endlineseparator="<" --fieldseparator=","
cm lock list --machinereadable --smartlocks --startlineseparator=">" --endlineseparator="<" --fieldseparator=","