It's all about the answers!

Ask a question

Set Owner of Snapshot (baselineset) using Java APIs


Scott Pecnik (1336) | asked Jan 19 '15, 9:59 p.m.
retagged Jan 20 '15, 2:04 p.m. by Evan Hughes (2.4k1218)
 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


permanent link
Shashikant Padur (4.2k27) | answered Jan 19 '15, 10:44 p.m.
JAZZ DEVELOPER
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.
Scott Pecnik selected this answer as the correct answer

Comments
Scott Pecnik commented Jan 20 '15, 1:49 a.m.

 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?


Shashikant Padur commented Jan 20 '15, 3:35 a.m. | edited Jan 20 '15, 3:39 a.m.
JAZZ DEVELOPER

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?


1
Scott Pecnik commented Jan 20 '15, 9:39 p.m.

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.

Your answer


Register or to post your answer.