Deliver specific changesets to different streams
I have the changeset reference and need to deliver selectively to specific streams - as all changesets are not applicable to be delivered. There wont be any conflicts as its in the required order.
Is it possible to deliver the selected changesets to streams without getting a total out-of-sync report?
Please advise.Thanks.
One answer
There are several ways how to do this. One would be to create a repository workspace from the stream you want to deliver to. Then you accept the changes you want into that repository workspace. Then you deliver the outgoing changes. If you have gaps, you would have to use the gap handling to get the change sets too.
You can accept change sets from work items, r you can search for them in different ways.
An out of sync typically only occurs, if one has the same repository workspace loaded and changed from different places. So it does not really play a role in this scenario at all.
Comments
Hi Ralph,
I want to deliver selective changesets from StreamA to StreamB [Not all]
I use WorkspaceA and complete delivering all my changes into StreamA. Now in order to deliver changes from WorkspaceA to StreamB, Changesync+deliver API doesnt provide an option to choose changesets to deliver [It will sync up StreamA and StreamB]
I am looking to deliver only certain changesets from StreamA to StreamB using API. Please advise.
All I can provide is https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/
Note that a stream is 99% the same as a repository workspace, so that code should work. You can compare the two streams and get a set of change sets. Maybe operate on that?
I don't have code to search for a specific change set.
However, I am aware that a similar other question was here on the forum.
Note, please try to put a little bit more effort into your questions and describe what you want to do and why.
I am looking for an API equivalent to CLI:"scm deliver -c"
where we can deliver selected changesets between source and target. Thanks.
This is the API I am aware of, from my blog post. Maybe start there?
System.out.println("Comparing Change Sets..."); IChangeHistorySyncReport changeSetSync = repoWorkspace.compareTo( targetStream, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, monitor); System.out.println("Deliver Change Sets..."); repoWorkspace.deliver(targetStream, changeSetSync, Collections.EMPTY_LIST, changeSetSync.outgoingChangeSets(component), monitor);