Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 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?

0 votes


Accepted answer

Permanent link

 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

0 votes

Comments

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);

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

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". 

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

Yes. 

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.

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 log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 1,700

Question asked: Jun 21 '19, 10:03 a.m.

Question was seen: 2,043 times

Last updated: Jun 25 '19, 4:07 p.m.

Confirmation Cancel Confirm