It's all about the answers!

Ask a question

What is cause of "Project out of sync" after executing accept() method for incoming baseline?


Andrew Ciaz (293) | asked Jun 21, 10:03 a.m.

 Hi Guys,


I implemented code which accept baseline using following code:
connection.accept(AcceptFlags.DEFAULT,targetStream, changeHistorySyncReport,Collections.singletonList(base),changeHistorySyncReport.incomingChangeSets(),monitor);

My program work without exception, but in "Pending Changes view", workspace sync context shows "Project out of sync". Could you please help me to the cause of this issue?

Accepted answer


permanent link
Ralph Schoon (55.3k23642) | answered Jun 24, 3:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Just because you accept something into a repository workspace does not necessarily mean it is automatically downloaded into any existing sandbox. So you accept a change into the repository workspace and the Eclipse that tracks the loaded sandbox detects that the local content is not the same as the repository workspace and lets you know.

Andrew Ciaz selected this answer as the correct answer

Comments
Andrew Ciaz commented Jun 24, 4:30 a.m.

Thanks @Ralph Schoon for your valuable answer, I totally agree with your findings, but when I accept incoming baselies and change sets through the code, my component history shows the changeset and baseline, but my sandbox files are not updated with remote files, below is my code:


connection.accept(AcceptFlags.DEFAULT,flowWorkspaceConnection, changeHistorySyncReport,Collections.singletonList(base),changeHistorySyncReport.incomingChangeSets(), monitor);


Andrew Ciaz commented Jun 24, 4:35 a.m.

And after running this code, my project is showing "out of sync"  error, what can I do to resolve this issue?


Ralph Schoon commented Jun 24, 4:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The Eclipse client loads the changed file content to disc. This is the part you are likely not doing and maybe fail to understand. I have not implemented such a load. I would suggest to look into the RTC Client SDK to find out what the RTC client does in Eclipse when you "Accept a change into a loaded repository workspace". 


Andrew Ciaz commented Jun 24, 5:12 a.m.

 @Ralph Schoon, you mean accepting change sets or baseline does not reflect changes into local sandbox. For that, I need to write code separately.


Ralph Schoon commented Jun 24, 5:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Yes. 


Geoffrey Clemm commented Jun 24, 3:44 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There probably is a special "accept" call within the client code that checks whether the workspace is loaded in a local sandbox, and then does the accept in way that causes the local sandbox to be updated.   I will ping the RTC SCM dev team to see if they can give you a pointer.


David Lafreniere commented Jun 25, 4:03 p.m. | edited Jun 25, 4:07 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

If you were in "RTC Eclipse ClientA" and performed an accept operation, and if that same repository workspace were tracked in the Pending Changes view of "RTC Eclipse ClientB", that Pending Changes view would go out of sync. This is the same thing that is happening in this case... if you are writing Java code, and invoking IWorkspaceConnection API, then it's similar to another 'client' performing the operation (i.e. the daemon and UI layer has no awareness that this code was called).

If you need to keep a running daemon aware of all changes, the official API for this is to use the lscm [command line]) (Java code can be written to call out to the command line).

You could also use the following operation (which is not official API) to keep the daemon/UI in sync. See: IWorkspaceUpdateOperation.accept(...) and StandardAcceptDilemmaHandler (You can see the code in 'AcceptChangeSetAction' as a reference as to how the operation is used).
-

showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.