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

Eclipse client API : find completed change sets

 Hello,


I am looking for an API that finds completed change-sets.
If I understand correctly, the API IChangeSet.isActive indicates whether change-set is completed (not active) or not.
I know the API IWorkspaceConnection.activeChangeSets() returns list of active change sets. Is there an API for non-active change-sets ?

Thanks.

0 votes



One answer

Permanent link
We don't have API for finding all closed change sets. I guess statistically speaking, most change sets in the database would be closed (i.e. anytime you deliver or discard a change set, or create a baseline, any open change sets get automatically closed).
Feel free to open an enhancement request.

(As a FYI even though it doesn't answer your question, in addition to IWorkspaceConnection.activeChangeSets(), this class is also relevant for querying for change sets: IChangeSetSearchCriteria, which is used in IWorkspaceManager.findChangeSets(...))

0 votes

Comments

 Hi David,

Thanks for your reply. Below is the manual scenario I am trying to solve with API:
1) User modifies file a.txt and performs check-in to new change-set cs1.
2) User completes cs1.
3) User modifies file a.txt again and performs check-in to new change-set cs2.
4) User tries to deliver cs2. An error is reported: Delivering these changes would introduce gaps in the stream.
5) User selects both cs1 and cs2 and delivers them successfully.

Is there an API (or a set of APIs) to find the completed cs1 ? I find cs2 by IWorkspaceConnection.activeChangeSets(), how do I find whether there are change-sets that introduce gaps ? If there is no such API, I'll open enhancement request.
Thanks.



You can get the IWorkspaceConnection for the stream that you are trying to deliver to, and call findChangeSetsToAcceptToFillGap(...) and see what that returns (Note: The API was designed for the accept use case, but it may returned desired results if used with the stream, I just have not tried it, if you do, post back the results to this forum)

Thanks for your reply, David. I have another use case I need to solve:

1) User performs several changes in file a.txt. Each change is checked-in to a change-set and the change-set is marked by the user as completed.
2) User wishes to deliver all his completed change-sets related to file a.txt.

I can use IFlowNodeConnection.changeHistory and IChangeHistory.getHistoryFor for both workspace connection and its target workspace connection for deliveries and then compare the two. Is this approach correct ? I stop at the first change-set which is part of the target workspace connection. In case the first change-set is active - I stop and return null, since the API you mentioned should solve this scenario.
Regarding finding the target workspace connection, I use IComponentSyncModel, which is internal API. Is there public API for this task ? Thanks.


Regarding the API findChangeSetsToAcceptToFillGap - seems that it is not working for deliver scenario.

I used it for accept scenario and it works well.

Should I report it as a defect ?

I found that the public API to find the target workspace connection is IWorkspaceConnection.getCurrentDeliverFlow().getFlowNode() and the transform the IFlowNodeHandle to IWorkspace using ITeamRepository.itemManager().fetchCompleteItem().


I am still unable to use the API findChangeSetsToAcceptToFillGap to calculate the gap. Should I use a different workspace connection ?

Yes that is the correct API to find the flow target.

IWC.findChangeSetsToAcceptToFillGap() was written to help with use cases of trying to accept changes into a workspace, and not really what to identify what can be delivered. I would have thought if you used that method on the flow target (stream) it might result in similar information. So if you call that API on the stream that you want to deliver to, what doesn't work for you? (what are the results when you try?)

showing 5 of 6 show 1 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,202

Question asked: Apr 22 '20, 1:04 p.m.

Question was seen: 2,194 times

Last updated: May 25 '20, 9:51 a.m.

Confirmation Cancel Confirm