How do you obtain list of change sets being delivered in a Baseline in a Deliver Operation Advisor
Thank you,
Jamie Berry.
One answer
IWorkspaceConnection connection = SCMPlatform.getWorkspaceManager(ITeamRepository).getWorkspaceConnection(DeliverOperationData.getSourceWorkspace(), monitor);connection.compareTo(destinationWorkspaceConnection, ..);
Comments
Thanks for your reply. I am doing this as part of a Deliver operation advisor, so I can't compare the two workspaces as not everything may be delivered. I have been looking at comparing the baseline that is being delivered to the destination workspace, I just have to figure out how to get the WorkspaceManager from the advisor as I don't have all the same objects as when just writing a stand-alone plain java api based client. Thanks again.
Oh right, the advisor is being run on the server. You should obtain IScmService to compare your baseline and workspace.
Jamie found https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ which should solve that part.
Thanks everyone. I have my advisor working as desired (for the most part) now. I wound up using:
IChangeHistorySyncReport syncRpt = scmService.compareWorkspaceToBaseline((IWorkspaceHandle)destWS.getItemHandle(), iBaselineHandle, null, null);
to compare the Baseline to the Destination workspace. The IncomingChangeSets then had the chagne sets in the Baseline that were being delivered. The only concern I have with this call is that scmService.compareWorkspaceToBaseline doesn't accept IProgressMonitor but uses IRepositoryProgressMonitorHandle . I didn't see a way to convert the monitor I have to the monitor handle, so I just used null. It works, but I don't know if there will be any issues with the progress not being reported for the baseline/workspace comparison... If anyone has hints on how to get the IRepositoryProgressMonitorHandle object from a server side delivery advisor, I would appreciate it.
Thanks again.
You can do something like this to get a repository monitor: