How to Sync a sandbox using Command Line Interface (SCM)
I figured this out the hard way after many trials and finding out that the documented and the online help for SCM commands are not very accurate!
If for some reason your sandbox is out of sync with the repository workspace (maybe you deleted or modified a file/folder by mistake) or progamatically you want to check and make sure your sandbox is insync without reloading everything then use the "load" command with the option --force (-f). Although the option is missleading it will not reload everything only the missing or changed files.
Looking at the SCM online help you woudl have thought that "Repair" would have been the right choice:
"The scm repair subcommand repairs a sandbox that has become corruptedor is out of sync with its counterpart in the repository."
If for some reason your sandbox is out of sync with the repository workspace (maybe you deleted or modified a file/folder by mistake) or progamatically you want to check and make sure your sandbox is insync without reloading everything then use the "load" command with the option --force (-f). Although the option is missleading it will not reload everything only the missing or changed files.
Looking at the SCM online help you woudl have thought that "Repair" would have been the right choice:
"The scm repair subcommand repairs a sandbox that has become corrupted
4 answers
I found this https://jazz.net/wiki/bin/view/Main/SCMCommandLineTutorial useful but misleading as it explains command options that do not exist!
For example:
I could not get any of the --message or --change-set options mentioned above to work!
For example:
scm checkin
Modifications you've made to your local workspace are copied to your remote workspace by running scm checkin. At its most basic, the checkin command looks like
scm checkin <path>
The subcommand takes one or more paths to things you want to check in. Everything under that path will be examined for changes and saved to a change-set in the remote workspace.
By default, resource changes are saved to the currently active change set. If there is no currently active change-set, one will be created. If you have multiple active change-sets, you can use a change-set selector to choose the one you want to receive the changes by providing the --change-set/-c option. To create a new change-set, use the --new-change-set/-n option. To close the change-set after your changes have been checked-in, specify --close-change-set/-C.
The --message/-m option will set the comment on the given change-set.
I could not get any of the --message or --change-set options mentioned above to work!
I found this https://jazz.net/wiki/bin/view/Main/SCMCommandLineTutorial useful but misleading as it explains command options that do not exist!
For example:
scm checkin
Modifications you've made to your local workspace are copied to your remote workspace by running scm checkin. At its most basic, the checkin command looks like
scm checkin <path>
The subcommand takes one or more paths to things you want to check in. Everything under that path will be examined for changes and saved to a change-set in the remote workspace.
By default, resource changes are saved to the currently active change set. If there is no currently active change-set, one will be created. If you have multiple active change-sets, you can use a change-set selector to choose the one you want to receive the changes by providing the --change-set/-c option. To create a new change-set, use the --new-change-set/-n option. To close the change-set after your changes have been checked-in, specify --close-change-set/-C.
The --message/-m option will set the comment on the given change-set.
I could not get any of the --message or --change-set options mentioned above to work!
Defect 197106 filed!