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, ...);
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
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.