API - Get change set list of a Stream ?
![]()
Use case:
To make report on change set delivery over a time on Stream. Need to get list of all change sets delivered for a Stream.
User knows Stream Name and provides this as an input, to get all changesets delivered for this stream.
Is there an API or change set exporter for a stream.?
|
Accepted answer
![]()
You can get the history of the component in your stream by using the following api:
ChangeHistoryWithBaselinesResult IWorkspaceConnection#ChangeHistoryWithBaselinesResult fetchChangeHistoryWithBaselines(IComponentHandle component, ChangeHistoryHandle nextPageToken, int pageSizeHint, IProgressMonitor monitor)
List<ChangeHistoryEntry> ChangeHistoryWithBaselinesResult#getChangeHistoryEntries() Ralph Schoon selected this answer as the correct answer
Comments can you provide the operation history API details (Stream). I need to know count how many change sets delivery happening on the stream daily.
1
Take a look at this forum link:
Before posting followup questions, please update if the previous suggested solution worked for you or not. This will help other forum members looking for solutions. Also, search the forum before posting the query.
Hello Shashikant,
I am unable to get ChangeHistoryWithBaselinesResult from IWorkspaceConnection object.
I find only IWorkspaceConnection.changeHistory(IComponentHandel). Could you tell me How to I get object of ChangeHistoryWithBaselinesResult ?
The IWorkspaceConnection#fetchChangeHistoryWithBaselines(...) was added in 701. Which version are you using?
We are still using 6.0.6.1 :( Hallo Shashikant ,
Could you provide API's which can used for 6.0.6.1 also. it would be great helpful.
Sorry, I couldn't respond earlier as I was on leave.
Hello Shashikant,
Wish you happy new year. Thanks for your earlier comment and support. From change, trying to find which file was changed. I got stuck in finding file name.
List<IChangeSet> changeSets = repository.itemManager().fetchCompleteItems(changeSetHandles, IItemManager.DEFAULT, progress);
looping each IChangeSet cs from List List<IChangeSet> changeSets and inner loop of IChange change
IVersionable versionalbe=compConfig.fetchCompleteItem(change.item(), monitor); this line gives me exception. Could you help which object , should use to get IFileItem from Change object.
IVersionableHandle versionableHandles = new ArrayList<IVersionableHandle>(changeSet.changes().size);
for (IChange change : (List<IChange>) changeSet.changes()) {
versionableHandles.add(change.afterState());
}
List<IVersionable> versionables = SCMPlatform.getWorkspaceManager(repo).versionableManager().fetchCompleteStates(versionableHandles, monitor);
versionables[i].getName(); // gives you the filename
Thanks a lot for the support, highly appreciate it. Below code worked for me.
for (IChange change : (List<IChange>) changeSet.changes()) {
IVersionable versionable= SCMPlatform.getWorkspaceManager(teamRepository).versionableManager().fetchCompleteState(change.afterState(), monitor);
}
need to take care for cases when file is deleted/removed from SCM , versionable will be null.
showing 5 of 10
show 5 more comments
|