How to find the origin stream of a snapshot?
One answer
In scm cli you could call 'scm show attributes --snapshot <name/alias/uuid>' to show the owner of the snapshot.
To get this info using the api:
1) Get the snapshot: IBaselineSet baselineSet = IWorkspaceManager#findBaselineSets(IBaselineSetSearchCriteria criteria, int maxResults, IProgressMonitor monitor);
1) Get the snapshot: IBaselineSet baselineSet = IWorkspaceManager#findBaselineSets(IBaselineSetSearchCriteria criteria, int maxResults, IProgressMonitor monitor);
2) Get the workspace/stream handle: IWorkspaceHandle wsHandle = baselineSet.getOwner();
3) Get the workspace/stream from the handle: IWorkspace workspace = ITeamRepository#itemManager()#fetchCompleteItem(wsHandle, ...);
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 19 '17, 2:53 a.m.Note that a snapshot does not have an "origin stream" (I assume by that, you mean the stream or workspace that it was created from) ... it has an "owner". Since the owner property of a snapshot can be changed, the owning stream/workspace may be completely unrelated to the content of the snapshot.