RTC-SCM-CLI: how to find out if a file in my sandbox already belongs to an active changeset ?
I'm writing a wrapper tool around RTC-SCM-CLI
Our requirement is that, during checkin of a file, the user should have the option
- to create a new changeset [or]
- select any other active changeset that is already present in that component
Once the user checks in a file into a changeset, as long as that changeset remains active, it is not possible for the user to link this file to another changeset during his subsequent checkin operations on that file. It would lead to the below error:
Is there a CLI command available which will let me know if a file in my sandbox already belongs to an active changeset of a component, given its relative path in the sandbox ?
(Once I have this information, then it is easier for me to force the user to either store his changes into that active changeset [or] close that active changeset and open a new one)
Thanks for your help.
Our requirement is that, during checkin of a file, the user should have the option
- to create a new changeset [or]
- select any other active changeset that is already present in that component
Once the user checks in a file into a changeset, as long as that changeset remains active, it is not possible for the user to link this file to another changeset during his subsequent checkin operations on that file. It would lead to the below error:
Cannot check-in <file> because it is already being changed in another active change set.Now, my question is, how the user can be prevented in getting into this situation ?
Instead of picking a specific change set, try allowing the check-in to pick the correct change set.
Is there a CLI command available which will let me know if a file in my sandbox already belongs to an active changeset of a component, given its relative path in the sandbox ?
(Once I have this information, then it is easier for me to force the user to either store his changes into that active changeset [or] close that active changeset and open a new one)
Thanks for your help.
One answer
You can run 'lscm status' command with -C option which will expand all the change sets. Look for the active change set for the component and check if the file path matches.
If you know the exact change set, you can list the changes in the change set (lscm list changes) and match the file path.
You can run with --json option to get the output in json format.