Can I get the snapshot label from the team.scm.snapshotUUID?
2 answers
First thing is to create a handle based on the UUID:
<pre>IBaselineSetHandle handle = IBaselineSet.ITEM_TYPE.createItemHandle(uuid, null);</pre>
On the client side you can use the item manager to fetch the full item:
<pre>IBaselineSet set = (IBaselineSet)workspaceConnection.teamRepository().itemManager().fetchCompleteItem(handle, IItemManager.DEFAULT, null);
set.getName()</pre>
On the server use the RepositoryItemService
<pre>
IRepositoryItemService service = OsgiServicesManager.INSTANCE.getService(IRepositoryItemService.class, null);
IBaselineSet snapshot = (IBaselineSet) service.fetchItem(handle, IRepositoryItemService.COMPLETE);
</pre>
From the command line, the only thing I can see to do is to list the snapshots and grep for the UUID. When using the command line you can use <tt>--show-uuid y</tt> (and perhaps also <tt>--show-alias n</tt>) to see the UUIDs.
<pre>
> ./lscm list workspaces -r ella -c aniefer
(1109) "Andrew - Android Stream Workspace" Andrew Niefer
(1110) "Andrew Development Workspace" Andrew Niefer
(1111) "aniefer Workspace" Andrew Niefer
(1112) "aniefer Workspace2" Andrew Niefer
> ./lscm --show-uuid y list snapshots -r ella --maximum 50 1109 | grep _ejqpMLWIEeGOwYY0KAk2eg
(1115:_ejqpMLWIEeGOwYY0KAk2eg) "Test Snapshot 1" Jun 13, 2012 2:49 PM
</pre>
Comments
WOW, is there a way to find that using command line or RTC eclipse client?
Thanks Jirong
Sorry, I assumed you were creating an extension of some sort and were working in Java. I added some info on the command line, I don't know how to do it using the client.
What I want to achieve is to embed the RTC snapshot information (or something else from which I can relate the source and binary) into the final deployment unit (war/ear/zip) produced by Maven.
Jazz Maven build definition outputs the following information in a Properties file. I am trying to figure out how to use this team.scm.snapshotUUID. I wish I can have the snapshot label instead of this UUID.
Tue Jun 19 11:43:13 EDT 2012
buildDefinitionId=Maven Build team.scm.workspaceUUID=_WXXnMK8nEeG6XI3ra9ra-A buildLabel=20120619-1143 team.scm.snapshotUUID=_ebRvnLolEeGyEcG77cy6sw
For the zip, snapshots cannot be exported as zip files. You'll have to create a workspace, load the content, and zip it up.
You might want to look into automating this in the build process. Then every build you do will have a zip of what it used.