It's all about the answers!

Ask a question

How to find the origin stream of a snapshot?

Zoran Tomaskovic (1113) | asked Oct 16 '17, 8:41 a.m.

I have a given snapshot and want to find on which origin stream it is based.

In eclipse and via SCM CLI I can find all snapshots of a stream. Is there something similar to this?
Or do I have to loop through all streams and seek for my given snapshot?

Kind regard,

Geoffrey Clemm commented 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.

One answer

permanent link
Shashikant Padur (4.2k27) | answered Oct 18 '17, 11:41 p.m.

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

Register or to post 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.