How to find the origin stream of a snapshot?
![]() I have a given snapshot and want to find on which origin stream it is based.
|
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);
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
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.