Set Owner of Snapshot (baselineset) using Java APIs
Hi,
I'm trying to change the owner of a baselineset from a repository workspace to a stream programatically. It looks like you can set the name or comment of a snapshot pretty easily using:
IScmService#setBaseLineSetComment()
But there is not option to set the owner. The only thing I have found that looks remotely correct is:
IWorkspaceConnection#addBaseLineSet()
But this does not work and I'm not quite sure what this API does.
Any help is much appreciated!
Thanks
Accepted answer
IWorkspaceConnection#addBaseLineSet() is the right api to associate the snapshot to the workspace/stream. Once you do that listing the snapshots associated with the workspace/stream will list it.
Comments
Hi Shashikant,
Thanks for the reply. When I do a listing on the stream that I used to call #addBaseLineSet() I do see the snapshot. However, in the client when I right-click on the stream and select "show-> snapshots" I do not see the snapshot. What is the difference between associating a snapshot and changing the owner of a snapshot?
It is the same. When you associate it to a stream the stream becomes the owner of the snapshot.
I would have expected 'show snapshots' on the stream to show your recently added snapshot. I am wondering if the client is returning the cached data. How about you try Search->Jazz Source Control->Snapshots?
Sorry for the slow response and thanks for the clarification! Turns out there were some other issues in my code that caused the api to behave unexpectedly. I'm all set now.
1 vote