create a new stream out of a snapshot using the server side api
Hello
I want to create a stream based on a snapshot. IScmService has the method "createWorkspaceFromBaselineSet" to create a workspace. Is there a similar method for streams available? If not what needs to be done to create a stream?
Thanx, Steffen
I want to create a stream based on a snapshot. IScmService has the method "createWorkspaceFromBaselineSet" to create a workspace. Is there a similar method for streams available? If not what needs to be done to create a stream?
Thanx, Steffen
2 answers
You use the same call. There is no difference between a stream and a workspace except for the stream flag. It's used for checks when SCM only permits operations on streams or does not permit operations on streams. In this case, this call is allowable for a stream.
Comments
Hello,
the code below creates a new stream and adds the component from the snapshot. unfortunately the component is empty:
// create a new stream
IScmService scmService = super.getService(IScmService.class);
WorkspaceRefreshResult i = scmService.createStream((IProcessAreaHandle) currentProjectArea.getItemHandle(), streamName, "description", null, null);
IWorkspace w = i.getWorkspace();
//get component handle
IComponent currentComponent = (IComponent) itemSvc.fetchItem(currentComponentHandle, IRepositoryItemService.COMPLETE);
//add componet to stream
IComponentOpDescriptor desc = IComponentOpDescriptor.FACTORY.addComponent(currentComponent, false);
scmService.updateComponents2(w, null, new IComponentOpDescriptor[] { desc }, true, false, IScmService.DELTA_PER_INVOCATION, null, null);
looks like I need to replace the compete with a IBaselineHandle form the snapshot. Any Idea how this can be done?
the code below creates a new stream and adds the component from the snapshot. unfortunately the component is empty:
// create a new stream
IScmService scmService = super.getService(IScmService.class);
WorkspaceRefreshResult i = scmService.createStream((IProcessAreaHandle) currentProjectArea.getItemHandle(), streamName, "description", null, null);
IWorkspace w = i.getWorkspace();
//get component handle
IComponent currentComponent = (IComponent) itemSvc.fetchItem(currentComponentHandle, IRepositoryItemService.COMPLETE);
//add componet to stream
IComponentOpDescriptor desc = IComponentOpDescriptor.FACTORY.addComponent(currentComponent, false);
scmService.updateComponents2(w, null, new IComponentOpDescriptor[] { desc }, true, false, IScmService.DELTA_PER_INVOCATION, null, null);
looks like I need to replace the compete with a IBaselineHandle form the snapshot. Any Idea how this can be done?
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 04 '14, 9:30 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 04 '14, 9:34 a.m.Steffen Kriese
Aug 05 '14, 5:02 a.m.Steffen Kriese
Aug 05 '14, 5:03 a.m.Steffen Kriese
Aug 05 '14, 5:13 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 05 '14, 5:32 a.m.Steffen Kriese
Aug 05 '14, 6:07 a.m.