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

How ILocateChangeset works internally?

 Hi guys,


I need to find out change set belongs to which baseline, but suppose my component "ABC" has two changesets which are "Base1" and "Base2" and my my changeset is present "Base1" the my following code returns all the two baseline while I execute ILocateChangeSet api, following is my code snippet:

ILocateChangeSetsSearchCriteria scope = ILocateChangeSetsSearchCriteria.FACTORY.create(changeSetHandleList , workspaceHandlesList, Collections.EMPTY_LIST, baselineHandleList);
List<ILocateChangeSetsSearchResult> locateChangeSetResults = manager.locateChangeSets(scope, monitor);
for(ILocateChangeSetsSearchResult result : locateChangeSetResults)
{

List<IBaselineHandle> baselineHandles = result.getBaselines();
for(IBaselineHandle handle : baselineHandles)
{

IBaseline base1 = (IBaseline) flowWorkspaceConnection.teamRepository().itemManager()
.fetchCompleteItem(handle,IItemManager.DEFAULT, null);
}
}

0 votes

Comments

I think the code should return only "Base1"  baseline which contain changeset but code returns all the baselines


Accepted answer

Permanent link
The Locate Change Sets API checks if the change set exists in the [component] history of the context (where context is a stream/workspace/baseline/snapshot).

For example, in the RTC Eclipse client, if you were to right-click on a component in either a workspace or stream and select "Show" --> "History", it will open up the History view showing all the change sets in that workspace/stream (in that component). When talking about streams, change sets usually get there via a 'deliver' action, but someone could have performed a 'replace' operation on the stream. For workspace, change sets can get there by the 'change set creation' operation', or by an 'accept' or even a 'resume' operation.

Similarly, for baselines, if you were to right-click on a baseline and select "Show" --> "History", it will do pretty much the same thing as when you performed that action on a stream or workspace. It will open up the History view and show all change sets in that baseline.

So if you were to find the change set in that History view, then it is considered 'in' that context, and if you don't find the change set then it's considered to be 'not' in that context (this is how the LCS API works).
Andrew Ciaz selected this answer as the correct answer

0 votes

Comments

Thanks  @David Lafreniere 

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,937
× 1,700

Question asked: Jun 18 '19, 5:30 a.m.

Question was seen: 1,608 times

Last updated: Jun 20 '19, 9:40 a.m.

Confirmation Cancel Confirm