Handle Project out of synch using Plain Java API after discarding changeset
After discarding changes i can not do any further changes using plain java, as project is out of synch, I must open EWM client press reload out of synch project, close it and go further. I tried to reload the project using code below but it gives this error
"Loading the directories in the file system would overwrite/remove existing directories."
which is clear as it want to over write the content of local workspace(sandbox) but it cant, notice that both requestreload and requestload giving the same error. which is logical, but how can I do force reload or reload which resynch the project. just like scm command
./scm.exe, load, --resync, -r repository uri .../ccm, -d sandboxPath
I used this code to reload my sandbox also load my workspace too
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo); List<IWorkspaceHandle> workspaceHandleList = getWorkspaceByName("BRM Stream Workspace"); ISharingManager sharingManager = FileSystemCore.getSharingManager(); |
Accepted answer
Ralph Schoon (63.6k●3●36●47)
| answered Jul 26 '22, 8:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 26 '22, 9:38 a.m. The SCM system gets out of sync, if someone modifies a Repository Workspace and that repository workspace is loaded.
Do not do that. You are not supposed to modify repository workspaces that are loaded in parallel. Repository workspaces do not handle this situation. The repository workspace assumes it is only loaded once and the SCM system monitors the loaded sandbox. If local files change, this is synced with the repository workspace in the server. If there are changes accepted into the repository workspace, these changes are synched into the sandbox.
You use streams, if you want to do parallel development to be able to deliver these changes. MJ Ranji selected this answer as the correct answer
Comments
MJ Ranji
commented Jul 26 '22, 10:41 a.m.
Yes I have read your post that said out of sync error is because of double loading workspace. but i Have it only once in EWM loaded.
Actually Rhapsody use the workspace to run and do tests on latest code in the workspace. The test create many artifacts, which should be undo or discarded in some case. I need the workspace be clean after the test as it was at the beginning.
The local workspace (sandbox) access by Rhapsody, once loaded in EWM client and My plain java API code have access to the local workspace(sandbox) too. Java Api should do loading latest repository workspace changes into sandbox and at the end clean unresolved or checked in changes.
It means I need a way to undo and discard changes that does not bring the state of version control into out of synch or repair state. Do you have any suggestion!
Currently we don't need to deliver these changes to repository workspace through corresponding streams. Parallel development come later on.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.