scm checkin fails when component is out of sync
When we have unresolved changes in our sandbox and attempt to execute a checkin, we can get an out of sync error because the workspace was potentially modified in Eclipse (e.g. changes accepted). The suggested resolution is to load --force, but that will remove all unresolved changes. There appears to be no way to continue forward, baring just copying all changed files away, doing the load, and then hand merging them back in.
Am I missing a key step?
scm load should have an option to not blindly overwrite all files. The --force option is required when there are no changes
scm load ....
scm load ...
[fail, already loaded]
it should just detect, already loaded, load is successful. Like an svn update.
2 answers
the workspace was potentially modified in Eclipse (e.g. changes accepted)If you are talking about the "repository workspace", which means that you have "scm" working in one sandbox, and "RTC Eclipse" working in another, with both connecting to the same repository workspace, then it is a big no no. This use case will cause "out of sync" without doubt.
If you simply use "scm" and "Eclipse" working in the same sandbox, I cannot imagine how it can cause "out of sync". And you'd better find out the pattern "out of sync" occurs.
Once a sandbox gets "out of sync", reloading the entire sandbox is usually the only option since RTC does not know which individual file is out of sync.
Comments
The general rule I recommend is "an operation that modifies the configuration of a workspace that is loaded into a sandbox should only be performed on a client that is connected to that sandbox". If you want to modify a workspace without access to the currently loaded sandbox with unresolved changes, you should "unload" the workspace from the currently loaded sandbox before performing those modifications. In particular, this means if you have any unresolved changes in the currently loaded sandbox, you should first either checkin those unresolved changes to save them, or undo those changes to throw them away.
I've submitted work item Improve handling of resynchronizing a workspace component (344701) to request better handling of unresolved changes when synchronizing a de-synchronized sandbox.
I've submitted work item Improve handling of resynchronizing a workspace component (344701) to request better handling of unresolved changes when synchronizing a de-synchronized sandbox.